go-tdlib/client/type.go

38435 lines
1.1 MiB
Go
Raw Normal View History

2021-10-22 16:24:12 +02:00
// AUTOGENERATED
package client
import (
"encoding/json"
)
const (
ClassAuthenticationCodeType = "AuthenticationCodeType"
2023-06-04 22:58:07 +02:00
ClassEmailAddressAuthentication = "EmailAddressAuthentication"
2021-10-22 16:24:12 +02:00
ClassAuthorizationState = "AuthorizationState"
ClassInputFile = "InputFile"
ClassThumbnailFormat = "ThumbnailFormat"
ClassMaskPoint = "MaskPoint"
2023-06-04 22:58:07 +02:00
ClassStickerFormat = "StickerFormat"
ClassStickerType = "StickerType"
ClassStickerFullType = "StickerFullType"
2021-10-22 16:24:12 +02:00
ClassPollType = "PollType"
ClassUserType = "UserType"
ClassInputChatPhoto = "InputChatPhoto"
ClassChatMemberStatus = "ChatMemberStatus"
ClassChatMembersFilter = "ChatMembersFilter"
ClassSupergroupMembersFilter = "SupergroupMembersFilter"
ClassSecretChatState = "SecretChatState"
ClassMessageSender = "MessageSender"
ClassMessageForwardOrigin = "MessageForwardOrigin"
2023-06-04 22:58:07 +02:00
ClassReactionType = "ReactionType"
2021-10-22 16:24:12 +02:00
ClassMessageSendingState = "MessageSendingState"
ClassNotificationSettingsScope = "NotificationSettingsScope"
ClassChatType = "ChatType"
ClassChatList = "ChatList"
ClassChatSource = "ChatSource"
2023-06-04 22:58:07 +02:00
ClassChatAvailableReactions = "ChatAvailableReactions"
2021-10-22 16:24:12 +02:00
ClassPublicChatType = "PublicChatType"
ClassChatActionBar = "ChatActionBar"
ClassKeyboardButtonType = "KeyboardButtonType"
ClassInlineKeyboardButtonType = "InlineKeyboardButtonType"
ClassReplyMarkup = "ReplyMarkup"
ClassLoginUrlInfo = "LoginUrlInfo"
ClassRichText = "RichText"
ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment"
ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment"
ClassPageBlock = "PageBlock"
ClassInputCredentials = "InputCredentials"
2023-06-04 22:58:07 +02:00
ClassPaymentProvider = "PaymentProvider"
ClassInputInvoice = "InputInvoice"
ClassMessageExtendedMedia = "MessageExtendedMedia"
2021-10-22 16:24:12 +02:00
ClassPassportElementType = "PassportElementType"
ClassPassportElement = "PassportElement"
ClassInputPassportElement = "InputPassportElement"
ClassPassportElementErrorSource = "PassportElementErrorSource"
ClassInputPassportElementErrorSource = "InputPassportElementErrorSource"
ClassMessageContent = "MessageContent"
ClassTextEntityType = "TextEntityType"
ClassMessageSchedulingState = "MessageSchedulingState"
ClassInputMessageContent = "InputMessageContent"
ClassSearchMessagesFilter = "SearchMessagesFilter"
ClassChatAction = "ChatAction"
ClassUserStatus = "UserStatus"
ClassCallDiscardReason = "CallDiscardReason"
ClassCallServerType = "CallServerType"
ClassCallState = "CallState"
2021-12-08 10:23:00 +01:00
ClassGroupCallVideoQuality = "GroupCallVideoQuality"
2021-10-22 16:24:12 +02:00
ClassCallProblem = "CallProblem"
ClassDiceStickers = "DiceStickers"
2023-06-04 22:58:07 +02:00
ClassSpeechRecognitionResult = "SpeechRecognitionResult"
2021-10-22 16:24:12 +02:00
ClassInputInlineQueryResult = "InputInlineQueryResult"
ClassInlineQueryResult = "InlineQueryResult"
ClassCallbackQueryPayload = "CallbackQueryPayload"
ClassChatEventAction = "ChatEventAction"
ClassLanguagePackStringValue = "LanguagePackStringValue"
2023-06-04 22:58:07 +02:00
ClassPremiumLimitType = "PremiumLimitType"
ClassPremiumFeature = "PremiumFeature"
ClassPremiumSource = "PremiumSource"
ClassStorePaymentPurpose = "StorePaymentPurpose"
2021-10-22 16:24:12 +02:00
ClassDeviceToken = "DeviceToken"
ClassBackgroundFill = "BackgroundFill"
ClassBackgroundType = "BackgroundType"
ClassInputBackground = "InputBackground"
ClassCanTransferOwnershipResult = "CanTransferOwnershipResult"
ClassCheckChatUsernameResult = "CheckChatUsernameResult"
2021-12-08 10:23:00 +01:00
ClassCheckStickerSetNameResult = "CheckStickerSetNameResult"
ClassResetPasswordResult = "ResetPasswordResult"
ClassMessageFileType = "MessageFileType"
2021-10-22 16:24:12 +02:00
ClassPushMessageContent = "PushMessageContent"
ClassNotificationType = "NotificationType"
ClassNotificationGroupType = "NotificationGroupType"
ClassOptionValue = "OptionValue"
ClassJsonValue = "JsonValue"
ClassUserPrivacySettingRule = "UserPrivacySettingRule"
ClassUserPrivacySetting = "UserPrivacySetting"
2023-06-04 22:58:07 +02:00
ClassSessionType = "SessionType"
2021-10-22 16:24:12 +02:00
ClassChatReportReason = "ChatReportReason"
2023-06-04 22:58:07 +02:00
ClassTargetChat = "TargetChat"
2021-12-08 10:23:00 +01:00
ClassInternalLinkType = "InternalLinkType"
2021-10-22 16:24:12 +02:00
ClassFileType = "FileType"
ClassNetworkType = "NetworkType"
ClassNetworkStatisticsEntry = "NetworkStatisticsEntry"
ClassConnectionState = "ConnectionState"
ClassTopChatCategory = "TopChatCategory"
ClassTMeUrlType = "TMeUrlType"
ClassSuggestedAction = "SuggestedAction"
ClassTextParseMode = "TextParseMode"
ClassProxyType = "ProxyType"
ClassStatisticalGraph = "StatisticalGraph"
ClassChatStatistics = "ChatStatistics"
2021-12-08 10:23:00 +01:00
ClassVectorPathCommand = "VectorPathCommand"
ClassBotCommandScope = "BotCommandScope"
2021-10-22 16:24:12 +02:00
ClassUpdate = "Update"
ClassLogStream = "LogStream"
ClassError = "Error"
ClassOk = "Ok"
ClassAuthenticationCodeInfo = "AuthenticationCodeInfo"
ClassEmailAddressAuthenticationCodeInfo = "EmailAddressAuthenticationCodeInfo"
ClassTextEntity = "TextEntity"
ClassTextEntities = "TextEntities"
ClassFormattedText = "FormattedText"
ClassTermsOfService = "TermsOfService"
ClassPasswordState = "PasswordState"
ClassRecoveryEmailAddress = "RecoveryEmailAddress"
ClassTemporaryPasswordState = "TemporaryPasswordState"
ClassLocalFile = "LocalFile"
ClassRemoteFile = "RemoteFile"
ClassFile = "File"
ClassPhotoSize = "PhotoSize"
ClassMinithumbnail = "Minithumbnail"
ClassThumbnail = "Thumbnail"
ClassMaskPosition = "MaskPosition"
2021-12-08 10:23:00 +01:00
ClassClosedVectorPath = "ClosedVectorPath"
2021-10-22 16:24:12 +02:00
ClassPollOption = "PollOption"
ClassAnimation = "Animation"
ClassAudio = "Audio"
ClassDocument = "Document"
ClassPhoto = "Photo"
ClassSticker = "Sticker"
ClassVideo = "Video"
ClassVideoNote = "VideoNote"
ClassVoiceNote = "VoiceNote"
2021-12-08 10:23:00 +01:00
ClassAnimatedEmoji = "AnimatedEmoji"
2021-10-22 16:24:12 +02:00
ClassContact = "Contact"
ClassLocation = "Location"
ClassVenue = "Venue"
ClassGame = "Game"
ClassPoll = "Poll"
ClassProfilePhoto = "ProfilePhoto"
ClassChatPhotoInfo = "ChatPhotoInfo"
ClassBotCommand = "BotCommand"
2021-12-08 10:23:00 +01:00
ClassBotCommands = "BotCommands"
2023-06-04 22:58:07 +02:00
ClassBotMenuButton = "BotMenuButton"
2021-10-22 16:24:12 +02:00
ClassChatLocation = "ChatLocation"
ClassAnimatedChatPhoto = "AnimatedChatPhoto"
ClassChatPhoto = "ChatPhoto"
ClassChatPhotos = "ChatPhotos"
2023-06-04 22:58:07 +02:00
ClassChatPermissions = "ChatPermissions"
ClassChatAdministratorRights = "ChatAdministratorRights"
ClassPremiumPaymentOption = "PremiumPaymentOption"
ClassEmojiStatus = "EmojiStatus"
ClassEmojiStatuses = "EmojiStatuses"
ClassUsernames = "Usernames"
2021-10-22 16:24:12 +02:00
ClassUser = "User"
2023-06-04 22:58:07 +02:00
ClassBotInfo = "BotInfo"
2021-10-22 16:24:12 +02:00
ClassUserFullInfo = "UserFullInfo"
ClassUsers = "Users"
ClassChatAdministrator = "ChatAdministrator"
ClassChatAdministrators = "ChatAdministrators"
ClassChatMember = "ChatMember"
ClassChatMembers = "ChatMembers"
2021-12-08 10:23:00 +01:00
ClassChatInviteLink = "ChatInviteLink"
ClassChatInviteLinks = "ChatInviteLinks"
ClassChatInviteLinkCount = "ChatInviteLinkCount"
ClassChatInviteLinkCounts = "ChatInviteLinkCounts"
ClassChatInviteLinkMember = "ChatInviteLinkMember"
ClassChatInviteLinkMembers = "ChatInviteLinkMembers"
ClassChatInviteLinkInfo = "ChatInviteLinkInfo"
ClassChatJoinRequest = "ChatJoinRequest"
ClassChatJoinRequests = "ChatJoinRequests"
ClassChatJoinRequestsInfo = "ChatJoinRequestsInfo"
2021-10-22 16:24:12 +02:00
ClassBasicGroup = "BasicGroup"
ClassBasicGroupFullInfo = "BasicGroupFullInfo"
ClassSupergroup = "Supergroup"
ClassSupergroupFullInfo = "SupergroupFullInfo"
ClassSecretChat = "SecretChat"
ClassMessageSenders = "MessageSenders"
2023-06-04 22:58:07 +02:00
ClassChatMessageSender = "ChatMessageSender"
ClassChatMessageSenders = "ChatMessageSenders"
2021-10-22 16:24:12 +02:00
ClassMessageForwardInfo = "MessageForwardInfo"
ClassMessageReplyInfo = "MessageReplyInfo"
2023-06-04 22:58:07 +02:00
ClassMessageReaction = "MessageReaction"
2021-10-22 16:24:12 +02:00
ClassMessageInteractionInfo = "MessageInteractionInfo"
2023-06-04 22:58:07 +02:00
ClassUnreadReaction = "UnreadReaction"
2021-10-22 16:24:12 +02:00
ClassMessage = "Message"
ClassMessages = "Messages"
ClassFoundMessages = "FoundMessages"
2023-06-04 22:58:07 +02:00
ClassFoundChatMessages = "FoundChatMessages"
2021-12-08 10:23:00 +01:00
ClassMessagePosition = "MessagePosition"
ClassMessagePositions = "MessagePositions"
ClassMessageCalendarDay = "MessageCalendarDay"
ClassMessageCalendar = "MessageCalendar"
ClassSponsoredMessage = "SponsoredMessage"
2023-06-04 22:58:07 +02:00
ClassSponsoredMessages = "SponsoredMessages"
ClassFileDownload = "FileDownload"
ClassDownloadedFileCounts = "DownloadedFileCounts"
ClassFoundFileDownloads = "FoundFileDownloads"
2021-10-22 16:24:12 +02:00
ClassChatNotificationSettings = "ChatNotificationSettings"
ClassScopeNotificationSettings = "ScopeNotificationSettings"
ClassDraftMessage = "DraftMessage"
ClassChatFilter = "ChatFilter"
ClassChatFilterInfo = "ChatFilterInfo"
ClassRecommendedChatFilter = "RecommendedChatFilter"
ClassRecommendedChatFilters = "RecommendedChatFilters"
ClassChatLists = "ChatLists"
ClassChatPosition = "ChatPosition"
2021-12-08 10:23:00 +01:00
ClassVideoChat = "VideoChat"
2021-10-22 16:24:12 +02:00
ClassChat = "Chat"
ClassChats = "Chats"
ClassChatNearby = "ChatNearby"
ClassChatsNearby = "ChatsNearby"
ClassKeyboardButton = "KeyboardButton"
ClassInlineKeyboardButton = "InlineKeyboardButton"
2023-06-04 22:58:07 +02:00
ClassWebAppInfo = "WebAppInfo"
2021-10-22 16:24:12 +02:00
ClassMessageThreadInfo = "MessageThreadInfo"
2023-06-04 22:58:07 +02:00
ClassForumTopicIcon = "ForumTopicIcon"
ClassForumTopicInfo = "ForumTopicInfo"
ClassForumTopic = "ForumTopic"
ClassForumTopics = "ForumTopics"
2021-10-22 16:24:12 +02:00
ClassPageBlockCaption = "PageBlockCaption"
ClassPageBlockListItem = "PageBlockListItem"
ClassPageBlockTableCell = "PageBlockTableCell"
ClassPageBlockRelatedArticle = "PageBlockRelatedArticle"
ClassWebPageInstantView = "WebPageInstantView"
ClassWebPage = "WebPage"
ClassCountryInfo = "CountryInfo"
ClassCountries = "Countries"
ClassPhoneNumberInfo = "PhoneNumberInfo"
ClassBankCardActionOpenUrl = "BankCardActionOpenUrl"
ClassBankCardInfo = "BankCardInfo"
ClassAddress = "Address"
2023-06-04 22:58:07 +02:00
ClassThemeParameters = "ThemeParameters"
2021-10-22 16:24:12 +02:00
ClassLabeledPricePart = "LabeledPricePart"
ClassInvoice = "Invoice"
ClassOrderInfo = "OrderInfo"
ClassShippingOption = "ShippingOption"
ClassSavedCredentials = "SavedCredentials"
2023-06-04 22:58:07 +02:00
ClassPaymentOption = "PaymentOption"
2021-10-22 16:24:12 +02:00
ClassPaymentForm = "PaymentForm"
ClassValidatedOrderInfo = "ValidatedOrderInfo"
ClassPaymentResult = "PaymentResult"
ClassPaymentReceipt = "PaymentReceipt"
ClassDatedFile = "DatedFile"
ClassDate = "Date"
ClassPersonalDetails = "PersonalDetails"
ClassIdentityDocument = "IdentityDocument"
ClassInputIdentityDocument = "InputIdentityDocument"
ClassPersonalDocument = "PersonalDocument"
ClassInputPersonalDocument = "InputPersonalDocument"
ClassPassportElements = "PassportElements"
ClassPassportElementError = "PassportElementError"
ClassPassportSuitableElement = "PassportSuitableElement"
ClassPassportRequiredElement = "PassportRequiredElement"
ClassPassportAuthorizationForm = "PassportAuthorizationForm"
ClassPassportElementsWithErrors = "PassportElementsWithErrors"
ClassEncryptedCredentials = "EncryptedCredentials"
ClassEncryptedPassportElement = "EncryptedPassportElement"
ClassInputPassportElementError = "InputPassportElementError"
ClassInputThumbnail = "InputThumbnail"
ClassMessageSendOptions = "MessageSendOptions"
ClassMessageCopyOptions = "MessageCopyOptions"
ClassStickers = "Stickers"
ClassEmojis = "Emojis"
ClassStickerSet = "StickerSet"
ClassStickerSetInfo = "StickerSetInfo"
ClassStickerSets = "StickerSets"
2023-06-04 22:58:07 +02:00
ClassTrendingStickerSets = "TrendingStickerSets"
2021-10-22 16:24:12 +02:00
ClassCallProtocol = "CallProtocol"
ClassCallServer = "CallServer"
ClassCallId = "CallId"
2021-12-08 10:23:00 +01:00
ClassGroupCallId = "GroupCallId"
2023-06-04 22:58:07 +02:00
ClassGroupCallStream = "GroupCallStream"
ClassGroupCallStreams = "GroupCallStreams"
ClassRtmpUrl = "RtmpUrl"
2021-12-08 10:23:00 +01:00
ClassGroupCallRecentSpeaker = "GroupCallRecentSpeaker"
ClassGroupCall = "GroupCall"
ClassGroupCallVideoSourceGroup = "GroupCallVideoSourceGroup"
ClassGroupCallParticipantVideoInfo = "GroupCallParticipantVideoInfo"
ClassGroupCallParticipant = "GroupCallParticipant"
2021-10-22 16:24:12 +02:00
ClassCall = "Call"
ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings"
2023-06-04 22:58:07 +02:00
ClassAddedReaction = "AddedReaction"
ClassAddedReactions = "AddedReactions"
ClassAvailableReaction = "AvailableReaction"
ClassAvailableReactions = "AvailableReactions"
ClassEmojiReaction = "EmojiReaction"
2021-10-22 16:24:12 +02:00
ClassAnimations = "Animations"
ClassImportedContacts = "ImportedContacts"
2023-06-04 22:58:07 +02:00
ClassAttachmentMenuBotColor = "AttachmentMenuBotColor"
ClassAttachmentMenuBot = "AttachmentMenuBot"
ClassSentWebAppMessage = "SentWebAppMessage"
2021-10-22 16:24:12 +02:00
ClassHttpUrl = "HttpUrl"
2023-06-04 22:58:07 +02:00
ClassUserLink = "UserLink"
2021-10-22 16:24:12 +02:00
ClassInlineQueryResults = "InlineQueryResults"
ClassCallbackQueryAnswer = "CallbackQueryAnswer"
ClassCustomRequestResult = "CustomRequestResult"
ClassGameHighScore = "GameHighScore"
ClassGameHighScores = "GameHighScores"
ClassChatEvent = "ChatEvent"
ClassChatEvents = "ChatEvents"
ClassChatEventLogFilters = "ChatEventLogFilters"
ClassLanguagePackString = "LanguagePackString"
ClassLanguagePackStrings = "LanguagePackStrings"
ClassLanguagePackInfo = "LanguagePackInfo"
ClassLocalizationTargetInfo = "LocalizationTargetInfo"
2023-06-04 22:58:07 +02:00
ClassPremiumLimit = "PremiumLimit"
ClassPremiumFeatures = "PremiumFeatures"
ClassPremiumFeaturePromotionAnimation = "PremiumFeaturePromotionAnimation"
ClassPremiumState = "PremiumState"
2021-10-22 16:24:12 +02:00
ClassPushReceiverId = "PushReceiverId"
ClassBackground = "Background"
ClassBackgrounds = "Backgrounds"
2021-12-08 10:23:00 +01:00
ClassThemeSettings = "ThemeSettings"
ClassChatTheme = "ChatTheme"
2021-10-22 16:24:12 +02:00
ClassHashtags = "Hashtags"
2023-06-04 22:58:07 +02:00
ClassNotificationSound = "NotificationSound"
ClassNotificationSounds = "NotificationSounds"
2021-10-22 16:24:12 +02:00
ClassNotification = "Notification"
ClassNotificationGroup = "NotificationGroup"
ClassJsonObjectMember = "JsonObjectMember"
ClassUserPrivacySettingRules = "UserPrivacySettingRules"
ClassAccountTtl = "AccountTtl"
2023-06-04 22:58:07 +02:00
ClassMessageAutoDeleteTime = "MessageAutoDeleteTime"
2021-10-22 16:24:12 +02:00
ClassSession = "Session"
ClassSessions = "Sessions"
ClassConnectedWebsite = "ConnectedWebsite"
ClassConnectedWebsites = "ConnectedWebsites"
ClassMessageLink = "MessageLink"
ClassMessageLinkInfo = "MessageLinkInfo"
ClassFilePart = "FilePart"
ClassStorageStatisticsByFileType = "StorageStatisticsByFileType"
ClassStorageStatisticsByChat = "StorageStatisticsByChat"
ClassStorageStatistics = "StorageStatistics"
ClassStorageStatisticsFast = "StorageStatisticsFast"
ClassDatabaseStatistics = "DatabaseStatistics"
ClassNetworkStatistics = "NetworkStatistics"
ClassAutoDownloadSettings = "AutoDownloadSettings"
ClassAutoDownloadSettingsPresets = "AutoDownloadSettingsPresets"
ClassTMeUrl = "TMeUrl"
ClassTMeUrls = "TMeUrls"
ClassCount = "Count"
ClassText = "Text"
ClassSeconds = "Seconds"
2023-06-04 22:58:07 +02:00
ClassFileDownloadedPrefixSize = "FileDownloadedPrefixSize"
2021-10-22 16:24:12 +02:00
ClassDeepLinkInfo = "DeepLinkInfo"
ClassProxy = "Proxy"
ClassProxies = "Proxies"
2023-06-04 22:58:07 +02:00
ClassInputSticker = "InputSticker"
2021-10-22 16:24:12 +02:00
ClassDateRange = "DateRange"
ClassStatisticalValue = "StatisticalValue"
ClassChatStatisticsMessageInteractionInfo = "ChatStatisticsMessageInteractionInfo"
ClassChatStatisticsMessageSenderInfo = "ChatStatisticsMessageSenderInfo"
ClassChatStatisticsAdministratorActionsInfo = "ChatStatisticsAdministratorActionsInfo"
ClassChatStatisticsInviterInfo = "ChatStatisticsInviterInfo"
ClassMessageStatistics = "MessageStatistics"
2021-12-08 10:23:00 +01:00
ClassPoint = "Point"
2021-10-22 16:24:12 +02:00
ClassUpdates = "Updates"
ClassLogVerbosityLevel = "LogVerbosityLevel"
ClassLogTags = "LogTags"
2023-06-04 22:58:07 +02:00
ClassUserSupportInfo = "UserSupportInfo"
2021-10-22 16:24:12 +02:00
ClassTestInt = "TestInt"
ClassTestString = "TestString"
ClassTestBytes = "TestBytes"
ClassTestVectorInt = "TestVectorInt"
ClassTestVectorIntObject = "TestVectorIntObject"
ClassTestVectorString = "TestVectorString"
ClassTestVectorStringObject = "TestVectorStringObject"
)
const (
2023-06-04 22:58:07 +02:00
TypeError = "error"
TypeOk = "ok"
TypeAuthenticationCodeTypeTelegramMessage = "authenticationCodeTypeTelegramMessage"
TypeAuthenticationCodeTypeSms = "authenticationCodeTypeSms"
TypeAuthenticationCodeTypeCall = "authenticationCodeTypeCall"
TypeAuthenticationCodeTypeFlashCall = "authenticationCodeTypeFlashCall"
TypeAuthenticationCodeTypeMissedCall = "authenticationCodeTypeMissedCall"
TypeAuthenticationCodeTypeFragment = "authenticationCodeTypeFragment"
TypeAuthenticationCodeInfo = "authenticationCodeInfo"
TypeEmailAddressAuthenticationCodeInfo = "emailAddressAuthenticationCodeInfo"
TypeEmailAddressAuthenticationCode = "emailAddressAuthenticationCode"
TypeEmailAddressAuthenticationAppleId = "emailAddressAuthenticationAppleId"
TypeEmailAddressAuthenticationGoogleId = "emailAddressAuthenticationGoogleId"
TypeTextEntity = "textEntity"
TypeTextEntities = "textEntities"
TypeFormattedText = "formattedText"
TypeTermsOfService = "termsOfService"
TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters"
TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber"
TypeAuthorizationStateWaitEmailAddress = "authorizationStateWaitEmailAddress"
TypeAuthorizationStateWaitEmailCode = "authorizationStateWaitEmailCode"
TypeAuthorizationStateWaitCode = "authorizationStateWaitCode"
TypeAuthorizationStateWaitOtherDeviceConfirmation = "authorizationStateWaitOtherDeviceConfirmation"
TypeAuthorizationStateWaitRegistration = "authorizationStateWaitRegistration"
TypeAuthorizationStateWaitPassword = "authorizationStateWaitPassword"
TypeAuthorizationStateReady = "authorizationStateReady"
TypeAuthorizationStateLoggingOut = "authorizationStateLoggingOut"
TypeAuthorizationStateClosing = "authorizationStateClosing"
TypeAuthorizationStateClosed = "authorizationStateClosed"
TypePasswordState = "passwordState"
TypeRecoveryEmailAddress = "recoveryEmailAddress"
TypeTemporaryPasswordState = "temporaryPasswordState"
TypeLocalFile = "localFile"
TypeRemoteFile = "remoteFile"
TypeFile = "file"
TypeInputFileId = "inputFileId"
TypeInputFileRemote = "inputFileRemote"
TypeInputFileLocal = "inputFileLocal"
TypeInputFileGenerated = "inputFileGenerated"
TypePhotoSize = "photoSize"
TypeMinithumbnail = "minithumbnail"
TypeThumbnailFormatJpeg = "thumbnailFormatJpeg"
TypeThumbnailFormatGif = "thumbnailFormatGif"
TypeThumbnailFormatMpeg4 = "thumbnailFormatMpeg4"
TypeThumbnailFormatPng = "thumbnailFormatPng"
TypeThumbnailFormatTgs = "thumbnailFormatTgs"
TypeThumbnailFormatWebm = "thumbnailFormatWebm"
TypeThumbnailFormatWebp = "thumbnailFormatWebp"
TypeThumbnail = "thumbnail"
TypeMaskPointForehead = "maskPointForehead"
TypeMaskPointEyes = "maskPointEyes"
TypeMaskPointMouth = "maskPointMouth"
TypeMaskPointChin = "maskPointChin"
TypeMaskPosition = "maskPosition"
TypeStickerFormatWebp = "stickerFormatWebp"
TypeStickerFormatTgs = "stickerFormatTgs"
TypeStickerFormatWebm = "stickerFormatWebm"
TypeStickerTypeRegular = "stickerTypeRegular"
TypeStickerTypeMask = "stickerTypeMask"
TypeStickerTypeCustomEmoji = "stickerTypeCustomEmoji"
TypeStickerFullTypeRegular = "stickerFullTypeRegular"
TypeStickerFullTypeMask = "stickerFullTypeMask"
TypeStickerFullTypeCustomEmoji = "stickerFullTypeCustomEmoji"
TypeClosedVectorPath = "closedVectorPath"
TypePollOption = "pollOption"
TypePollTypeRegular = "pollTypeRegular"
TypePollTypeQuiz = "pollTypeQuiz"
TypeAnimation = "animation"
TypeAudio = "audio"
TypeDocument = "document"
TypePhoto = "photo"
TypeSticker = "sticker"
TypeVideo = "video"
TypeVideoNote = "videoNote"
TypeVoiceNote = "voiceNote"
TypeAnimatedEmoji = "animatedEmoji"
TypeContact = "contact"
TypeLocation = "location"
TypeVenue = "venue"
TypeGame = "game"
TypePoll = "poll"
TypeProfilePhoto = "profilePhoto"
TypeChatPhotoInfo = "chatPhotoInfo"
TypeUserTypeRegular = "userTypeRegular"
TypeUserTypeDeleted = "userTypeDeleted"
TypeUserTypeBot = "userTypeBot"
TypeUserTypeUnknown = "userTypeUnknown"
TypeBotCommand = "botCommand"
TypeBotCommands = "botCommands"
TypeBotMenuButton = "botMenuButton"
TypeChatLocation = "chatLocation"
TypeAnimatedChatPhoto = "animatedChatPhoto"
TypeChatPhoto = "chatPhoto"
TypeChatPhotos = "chatPhotos"
TypeInputChatPhotoPrevious = "inputChatPhotoPrevious"
TypeInputChatPhotoStatic = "inputChatPhotoStatic"
TypeInputChatPhotoAnimation = "inputChatPhotoAnimation"
TypeChatPermissions = "chatPermissions"
TypeChatAdministratorRights = "chatAdministratorRights"
TypePremiumPaymentOption = "premiumPaymentOption"
TypeEmojiStatus = "emojiStatus"
TypeEmojiStatuses = "emojiStatuses"
TypeUsernames = "usernames"
TypeUser = "user"
TypeBotInfo = "botInfo"
TypeUserFullInfo = "userFullInfo"
TypeUsers = "users"
TypeChatAdministrator = "chatAdministrator"
TypeChatAdministrators = "chatAdministrators"
TypeChatMemberStatusCreator = "chatMemberStatusCreator"
TypeChatMemberStatusAdministrator = "chatMemberStatusAdministrator"
TypeChatMemberStatusMember = "chatMemberStatusMember"
TypeChatMemberStatusRestricted = "chatMemberStatusRestricted"
TypeChatMemberStatusLeft = "chatMemberStatusLeft"
TypeChatMemberStatusBanned = "chatMemberStatusBanned"
TypeChatMember = "chatMember"
TypeChatMembers = "chatMembers"
TypeChatMembersFilterContacts = "chatMembersFilterContacts"
TypeChatMembersFilterAdministrators = "chatMembersFilterAdministrators"
TypeChatMembersFilterMembers = "chatMembersFilterMembers"
TypeChatMembersFilterMention = "chatMembersFilterMention"
TypeChatMembersFilterRestricted = "chatMembersFilterRestricted"
TypeChatMembersFilterBanned = "chatMembersFilterBanned"
TypeChatMembersFilterBots = "chatMembersFilterBots"
TypeSupergroupMembersFilterRecent = "supergroupMembersFilterRecent"
TypeSupergroupMembersFilterContacts = "supergroupMembersFilterContacts"
TypeSupergroupMembersFilterAdministrators = "supergroupMembersFilterAdministrators"
TypeSupergroupMembersFilterSearch = "supergroupMembersFilterSearch"
TypeSupergroupMembersFilterRestricted = "supergroupMembersFilterRestricted"
TypeSupergroupMembersFilterBanned = "supergroupMembersFilterBanned"
TypeSupergroupMembersFilterMention = "supergroupMembersFilterMention"
TypeSupergroupMembersFilterBots = "supergroupMembersFilterBots"
TypeChatInviteLink = "chatInviteLink"
TypeChatInviteLinks = "chatInviteLinks"
TypeChatInviteLinkCount = "chatInviteLinkCount"
TypeChatInviteLinkCounts = "chatInviteLinkCounts"
TypeChatInviteLinkMember = "chatInviteLinkMember"
TypeChatInviteLinkMembers = "chatInviteLinkMembers"
TypeChatInviteLinkInfo = "chatInviteLinkInfo"
TypeChatJoinRequest = "chatJoinRequest"
TypeChatJoinRequests = "chatJoinRequests"
TypeChatJoinRequestsInfo = "chatJoinRequestsInfo"
TypeBasicGroup = "basicGroup"
TypeBasicGroupFullInfo = "basicGroupFullInfo"
TypeSupergroup = "supergroup"
TypeSupergroupFullInfo = "supergroupFullInfo"
TypeSecretChatStatePending = "secretChatStatePending"
TypeSecretChatStateReady = "secretChatStateReady"
TypeSecretChatStateClosed = "secretChatStateClosed"
TypeSecretChat = "secretChat"
TypeMessageSenderUser = "messageSenderUser"
TypeMessageSenderChat = "messageSenderChat"
TypeMessageSenders = "messageSenders"
TypeChatMessageSender = "chatMessageSender"
TypeChatMessageSenders = "chatMessageSenders"
TypeMessageForwardOriginUser = "messageForwardOriginUser"
TypeMessageForwardOriginChat = "messageForwardOriginChat"
TypeMessageForwardOriginHiddenUser = "messageForwardOriginHiddenUser"
TypeMessageForwardOriginChannel = "messageForwardOriginChannel"
TypeMessageForwardOriginMessageImport = "messageForwardOriginMessageImport"
TypeReactionTypeEmoji = "reactionTypeEmoji"
TypeReactionTypeCustomEmoji = "reactionTypeCustomEmoji"
TypeMessageForwardInfo = "messageForwardInfo"
TypeMessageReplyInfo = "messageReplyInfo"
TypeMessageReaction = "messageReaction"
TypeMessageInteractionInfo = "messageInteractionInfo"
TypeUnreadReaction = "unreadReaction"
TypeMessageSendingStatePending = "messageSendingStatePending"
TypeMessageSendingStateFailed = "messageSendingStateFailed"
TypeMessage = "message"
TypeMessages = "messages"
TypeFoundMessages = "foundMessages"
TypeFoundChatMessages = "foundChatMessages"
TypeMessagePosition = "messagePosition"
TypeMessagePositions = "messagePositions"
TypeMessageCalendarDay = "messageCalendarDay"
TypeMessageCalendar = "messageCalendar"
TypeSponsoredMessage = "sponsoredMessage"
TypeSponsoredMessages = "sponsoredMessages"
TypeFileDownload = "fileDownload"
TypeDownloadedFileCounts = "downloadedFileCounts"
TypeFoundFileDownloads = "foundFileDownloads"
TypeNotificationSettingsScopePrivateChats = "notificationSettingsScopePrivateChats"
TypeNotificationSettingsScopeGroupChats = "notificationSettingsScopeGroupChats"
TypeNotificationSettingsScopeChannelChats = "notificationSettingsScopeChannelChats"
TypeChatNotificationSettings = "chatNotificationSettings"
TypeScopeNotificationSettings = "scopeNotificationSettings"
TypeDraftMessage = "draftMessage"
TypeChatTypePrivate = "chatTypePrivate"
TypeChatTypeBasicGroup = "chatTypeBasicGroup"
TypeChatTypeSupergroup = "chatTypeSupergroup"
TypeChatTypeSecret = "chatTypeSecret"
TypeChatFilter = "chatFilter"
TypeChatFilterInfo = "chatFilterInfo"
TypeRecommendedChatFilter = "recommendedChatFilter"
TypeRecommendedChatFilters = "recommendedChatFilters"
TypeChatListMain = "chatListMain"
TypeChatListArchive = "chatListArchive"
TypeChatListFilter = "chatListFilter"
TypeChatLists = "chatLists"
TypeChatSourceMtprotoProxy = "chatSourceMtprotoProxy"
TypeChatSourcePublicServiceAnnouncement = "chatSourcePublicServiceAnnouncement"
TypeChatPosition = "chatPosition"
TypeChatAvailableReactionsAll = "chatAvailableReactionsAll"
TypeChatAvailableReactionsSome = "chatAvailableReactionsSome"
TypeVideoChat = "videoChat"
TypeChat = "chat"
TypeChats = "chats"
TypeChatNearby = "chatNearby"
TypeChatsNearby = "chatsNearby"
TypePublicChatTypeHasUsername = "publicChatTypeHasUsername"
TypePublicChatTypeIsLocationBased = "publicChatTypeIsLocationBased"
TypeChatActionBarReportSpam = "chatActionBarReportSpam"
TypeChatActionBarReportUnrelatedLocation = "chatActionBarReportUnrelatedLocation"
TypeChatActionBarInviteMembers = "chatActionBarInviteMembers"
TypeChatActionBarReportAddBlock = "chatActionBarReportAddBlock"
TypeChatActionBarAddContact = "chatActionBarAddContact"
TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber"
TypeChatActionBarJoinRequest = "chatActionBarJoinRequest"
TypeKeyboardButtonTypeText = "keyboardButtonTypeText"
TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber"
TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation"
TypeKeyboardButtonTypeRequestPoll = "keyboardButtonTypeRequestPoll"
TypeKeyboardButtonTypeWebApp = "keyboardButtonTypeWebApp"
TypeKeyboardButton = "keyboardButton"
TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl"
TypeInlineKeyboardButtonTypeLoginUrl = "inlineKeyboardButtonTypeLoginUrl"
TypeInlineKeyboardButtonTypeWebApp = "inlineKeyboardButtonTypeWebApp"
TypeInlineKeyboardButtonTypeCallback = "inlineKeyboardButtonTypeCallback"
TypeInlineKeyboardButtonTypeCallbackWithPassword = "inlineKeyboardButtonTypeCallbackWithPassword"
TypeInlineKeyboardButtonTypeCallbackGame = "inlineKeyboardButtonTypeCallbackGame"
TypeInlineKeyboardButtonTypeSwitchInline = "inlineKeyboardButtonTypeSwitchInline"
TypeInlineKeyboardButtonTypeBuy = "inlineKeyboardButtonTypeBuy"
TypeInlineKeyboardButtonTypeUser = "inlineKeyboardButtonTypeUser"
TypeInlineKeyboardButton = "inlineKeyboardButton"
TypeReplyMarkupRemoveKeyboard = "replyMarkupRemoveKeyboard"
TypeReplyMarkupForceReply = "replyMarkupForceReply"
TypeReplyMarkupShowKeyboard = "replyMarkupShowKeyboard"
TypeReplyMarkupInlineKeyboard = "replyMarkupInlineKeyboard"
TypeLoginUrlInfoOpen = "loginUrlInfoOpen"
TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation"
TypeWebAppInfo = "webAppInfo"
TypeMessageThreadInfo = "messageThreadInfo"
TypeForumTopicIcon = "forumTopicIcon"
TypeForumTopicInfo = "forumTopicInfo"
TypeForumTopic = "forumTopic"
TypeForumTopics = "forumTopics"
TypeRichTextPlain = "richTextPlain"
TypeRichTextBold = "richTextBold"
TypeRichTextItalic = "richTextItalic"
TypeRichTextUnderline = "richTextUnderline"
TypeRichTextStrikethrough = "richTextStrikethrough"
TypeRichTextFixed = "richTextFixed"
TypeRichTextUrl = "richTextUrl"
TypeRichTextEmailAddress = "richTextEmailAddress"
TypeRichTextSubscript = "richTextSubscript"
TypeRichTextSuperscript = "richTextSuperscript"
TypeRichTextMarked = "richTextMarked"
TypeRichTextPhoneNumber = "richTextPhoneNumber"
TypeRichTextIcon = "richTextIcon"
TypeRichTextReference = "richTextReference"
TypeRichTextAnchor = "richTextAnchor"
TypeRichTextAnchorLink = "richTextAnchorLink"
TypeRichTexts = "richTexts"
TypePageBlockCaption = "pageBlockCaption"
TypePageBlockListItem = "pageBlockListItem"
TypePageBlockHorizontalAlignmentLeft = "pageBlockHorizontalAlignmentLeft"
TypePageBlockHorizontalAlignmentCenter = "pageBlockHorizontalAlignmentCenter"
TypePageBlockHorizontalAlignmentRight = "pageBlockHorizontalAlignmentRight"
TypePageBlockVerticalAlignmentTop = "pageBlockVerticalAlignmentTop"
TypePageBlockVerticalAlignmentMiddle = "pageBlockVerticalAlignmentMiddle"
TypePageBlockVerticalAlignmentBottom = "pageBlockVerticalAlignmentBottom"
TypePageBlockTableCell = "pageBlockTableCell"
TypePageBlockRelatedArticle = "pageBlockRelatedArticle"
TypePageBlockTitle = "pageBlockTitle"
TypePageBlockSubtitle = "pageBlockSubtitle"
TypePageBlockAuthorDate = "pageBlockAuthorDate"
TypePageBlockHeader = "pageBlockHeader"
TypePageBlockSubheader = "pageBlockSubheader"
TypePageBlockKicker = "pageBlockKicker"
TypePageBlockParagraph = "pageBlockParagraph"
TypePageBlockPreformatted = "pageBlockPreformatted"
TypePageBlockFooter = "pageBlockFooter"
TypePageBlockDivider = "pageBlockDivider"
TypePageBlockAnchor = "pageBlockAnchor"
TypePageBlockList = "pageBlockList"
TypePageBlockBlockQuote = "pageBlockBlockQuote"
TypePageBlockPullQuote = "pageBlockPullQuote"
TypePageBlockAnimation = "pageBlockAnimation"
TypePageBlockAudio = "pageBlockAudio"
TypePageBlockPhoto = "pageBlockPhoto"
TypePageBlockVideo = "pageBlockVideo"
TypePageBlockVoiceNote = "pageBlockVoiceNote"
TypePageBlockCover = "pageBlockCover"
TypePageBlockEmbedded = "pageBlockEmbedded"
TypePageBlockEmbeddedPost = "pageBlockEmbeddedPost"
TypePageBlockCollage = "pageBlockCollage"
TypePageBlockSlideshow = "pageBlockSlideshow"
TypePageBlockChatLink = "pageBlockChatLink"
TypePageBlockTable = "pageBlockTable"
TypePageBlockDetails = "pageBlockDetails"
TypePageBlockRelatedArticles = "pageBlockRelatedArticles"
TypePageBlockMap = "pageBlockMap"
TypeWebPageInstantView = "webPageInstantView"
TypeWebPage = "webPage"
TypeCountryInfo = "countryInfo"
TypeCountries = "countries"
TypePhoneNumberInfo = "phoneNumberInfo"
TypeBankCardActionOpenUrl = "bankCardActionOpenUrl"
TypeBankCardInfo = "bankCardInfo"
TypeAddress = "address"
TypeThemeParameters = "themeParameters"
TypeLabeledPricePart = "labeledPricePart"
TypeInvoice = "invoice"
TypeOrderInfo = "orderInfo"
TypeShippingOption = "shippingOption"
TypeSavedCredentials = "savedCredentials"
TypeInputCredentialsSaved = "inputCredentialsSaved"
TypeInputCredentialsNew = "inputCredentialsNew"
TypeInputCredentialsApplePay = "inputCredentialsApplePay"
TypeInputCredentialsGooglePay = "inputCredentialsGooglePay"
TypePaymentProviderSmartGlocal = "paymentProviderSmartGlocal"
TypePaymentProviderStripe = "paymentProviderStripe"
TypePaymentProviderOther = "paymentProviderOther"
TypePaymentOption = "paymentOption"
TypePaymentForm = "paymentForm"
TypeValidatedOrderInfo = "validatedOrderInfo"
TypePaymentResult = "paymentResult"
TypePaymentReceipt = "paymentReceipt"
TypeInputInvoiceMessage = "inputInvoiceMessage"
TypeInputInvoiceName = "inputInvoiceName"
TypeMessageExtendedMediaPreview = "messageExtendedMediaPreview"
TypeMessageExtendedMediaPhoto = "messageExtendedMediaPhoto"
TypeMessageExtendedMediaVideo = "messageExtendedMediaVideo"
TypeMessageExtendedMediaUnsupported = "messageExtendedMediaUnsupported"
TypeDatedFile = "datedFile"
TypePassportElementTypePersonalDetails = "passportElementTypePersonalDetails"
TypePassportElementTypePassport = "passportElementTypePassport"
TypePassportElementTypeDriverLicense = "passportElementTypeDriverLicense"
TypePassportElementTypeIdentityCard = "passportElementTypeIdentityCard"
TypePassportElementTypeInternalPassport = "passportElementTypeInternalPassport"
TypePassportElementTypeAddress = "passportElementTypeAddress"
TypePassportElementTypeUtilityBill = "passportElementTypeUtilityBill"
TypePassportElementTypeBankStatement = "passportElementTypeBankStatement"
TypePassportElementTypeRentalAgreement = "passportElementTypeRentalAgreement"
TypePassportElementTypePassportRegistration = "passportElementTypePassportRegistration"
TypePassportElementTypeTemporaryRegistration = "passportElementTypeTemporaryRegistration"
TypePassportElementTypePhoneNumber = "passportElementTypePhoneNumber"
TypePassportElementTypeEmailAddress = "passportElementTypeEmailAddress"
TypeDate = "date"
TypePersonalDetails = "personalDetails"
TypeIdentityDocument = "identityDocument"
TypeInputIdentityDocument = "inputIdentityDocument"
TypePersonalDocument = "personalDocument"
TypeInputPersonalDocument = "inputPersonalDocument"
TypePassportElementPersonalDetails = "passportElementPersonalDetails"
TypePassportElementPassport = "passportElementPassport"
TypePassportElementDriverLicense = "passportElementDriverLicense"
TypePassportElementIdentityCard = "passportElementIdentityCard"
TypePassportElementInternalPassport = "passportElementInternalPassport"
TypePassportElementAddress = "passportElementAddress"
TypePassportElementUtilityBill = "passportElementUtilityBill"
TypePassportElementBankStatement = "passportElementBankStatement"
TypePassportElementRentalAgreement = "passportElementRentalAgreement"
TypePassportElementPassportRegistration = "passportElementPassportRegistration"
TypePassportElementTemporaryRegistration = "passportElementTemporaryRegistration"
TypePassportElementPhoneNumber = "passportElementPhoneNumber"
TypePassportElementEmailAddress = "passportElementEmailAddress"
TypeInputPassportElementPersonalDetails = "inputPassportElementPersonalDetails"
TypeInputPassportElementPassport = "inputPassportElementPassport"
TypeInputPassportElementDriverLicense = "inputPassportElementDriverLicense"
TypeInputPassportElementIdentityCard = "inputPassportElementIdentityCard"
TypeInputPassportElementInternalPassport = "inputPassportElementInternalPassport"
TypeInputPassportElementAddress = "inputPassportElementAddress"
TypeInputPassportElementUtilityBill = "inputPassportElementUtilityBill"
TypeInputPassportElementBankStatement = "inputPassportElementBankStatement"
TypeInputPassportElementRentalAgreement = "inputPassportElementRentalAgreement"
TypeInputPassportElementPassportRegistration = "inputPassportElementPassportRegistration"
TypeInputPassportElementTemporaryRegistration = "inputPassportElementTemporaryRegistration"
TypeInputPassportElementPhoneNumber = "inputPassportElementPhoneNumber"
TypeInputPassportElementEmailAddress = "inputPassportElementEmailAddress"
TypePassportElements = "passportElements"
TypePassportElementErrorSourceUnspecified = "passportElementErrorSourceUnspecified"
TypePassportElementErrorSourceDataField = "passportElementErrorSourceDataField"
TypePassportElementErrorSourceFrontSide = "passportElementErrorSourceFrontSide"
TypePassportElementErrorSourceReverseSide = "passportElementErrorSourceReverseSide"
TypePassportElementErrorSourceSelfie = "passportElementErrorSourceSelfie"
TypePassportElementErrorSourceTranslationFile = "passportElementErrorSourceTranslationFile"
TypePassportElementErrorSourceTranslationFiles = "passportElementErrorSourceTranslationFiles"
TypePassportElementErrorSourceFile = "passportElementErrorSourceFile"
TypePassportElementErrorSourceFiles = "passportElementErrorSourceFiles"
TypePassportElementError = "passportElementError"
TypePassportSuitableElement = "passportSuitableElement"
TypePassportRequiredElement = "passportRequiredElement"
TypePassportAuthorizationForm = "passportAuthorizationForm"
TypePassportElementsWithErrors = "passportElementsWithErrors"
TypeEncryptedCredentials = "encryptedCredentials"
TypeEncryptedPassportElement = "encryptedPassportElement"
TypeInputPassportElementErrorSourceUnspecified = "inputPassportElementErrorSourceUnspecified"
TypeInputPassportElementErrorSourceDataField = "inputPassportElementErrorSourceDataField"
TypeInputPassportElementErrorSourceFrontSide = "inputPassportElementErrorSourceFrontSide"
TypeInputPassportElementErrorSourceReverseSide = "inputPassportElementErrorSourceReverseSide"
TypeInputPassportElementErrorSourceSelfie = "inputPassportElementErrorSourceSelfie"
TypeInputPassportElementErrorSourceTranslationFile = "inputPassportElementErrorSourceTranslationFile"
TypeInputPassportElementErrorSourceTranslationFiles = "inputPassportElementErrorSourceTranslationFiles"
TypeInputPassportElementErrorSourceFile = "inputPassportElementErrorSourceFile"
TypeInputPassportElementErrorSourceFiles = "inputPassportElementErrorSourceFiles"
TypeInputPassportElementError = "inputPassportElementError"
TypeMessageText = "messageText"
TypeMessageAnimation = "messageAnimation"
TypeMessageAudio = "messageAudio"
TypeMessageDocument = "messageDocument"
TypeMessagePhoto = "messagePhoto"
TypeMessageExpiredPhoto = "messageExpiredPhoto"
TypeMessageSticker = "messageSticker"
TypeMessageVideo = "messageVideo"
TypeMessageExpiredVideo = "messageExpiredVideo"
TypeMessageVideoNote = "messageVideoNote"
TypeMessageVoiceNote = "messageVoiceNote"
TypeMessageLocation = "messageLocation"
TypeMessageVenue = "messageVenue"
TypeMessageContact = "messageContact"
TypeMessageAnimatedEmoji = "messageAnimatedEmoji"
TypeMessageDice = "messageDice"
TypeMessageGame = "messageGame"
TypeMessagePoll = "messagePoll"
TypeMessageInvoice = "messageInvoice"
TypeMessageCall = "messageCall"
TypeMessageVideoChatScheduled = "messageVideoChatScheduled"
TypeMessageVideoChatStarted = "messageVideoChatStarted"
TypeMessageVideoChatEnded = "messageVideoChatEnded"
TypeMessageInviteVideoChatParticipants = "messageInviteVideoChatParticipants"
TypeMessageBasicGroupChatCreate = "messageBasicGroupChatCreate"
TypeMessageSupergroupChatCreate = "messageSupergroupChatCreate"
TypeMessageChatChangeTitle = "messageChatChangeTitle"
TypeMessageChatChangePhoto = "messageChatChangePhoto"
TypeMessageChatDeletePhoto = "messageChatDeletePhoto"
TypeMessageChatAddMembers = "messageChatAddMembers"
TypeMessageChatJoinByLink = "messageChatJoinByLink"
TypeMessageChatJoinByRequest = "messageChatJoinByRequest"
TypeMessageChatDeleteMember = "messageChatDeleteMember"
TypeMessageChatUpgradeTo = "messageChatUpgradeTo"
TypeMessageChatUpgradeFrom = "messageChatUpgradeFrom"
TypeMessagePinMessage = "messagePinMessage"
TypeMessageScreenshotTaken = "messageScreenshotTaken"
TypeMessageChatSetTheme = "messageChatSetTheme"
TypeMessageChatSetMessageAutoDeleteTime = "messageChatSetMessageAutoDeleteTime"
TypeMessageForumTopicCreated = "messageForumTopicCreated"
TypeMessageForumTopicEdited = "messageForumTopicEdited"
TypeMessageForumTopicIsClosedToggled = "messageForumTopicIsClosedToggled"
TypeMessageForumTopicIsHiddenToggled = "messageForumTopicIsHiddenToggled"
TypeMessageSuggestProfilePhoto = "messageSuggestProfilePhoto"
TypeMessageCustomServiceAction = "messageCustomServiceAction"
TypeMessageGameScore = "messageGameScore"
TypeMessagePaymentSuccessful = "messagePaymentSuccessful"
TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot"
TypeMessageGiftedPremium = "messageGiftedPremium"
TypeMessageContactRegistered = "messageContactRegistered"
TypeMessageWebsiteConnected = "messageWebsiteConnected"
TypeMessageBotWriteAccessAllowed = "messageBotWriteAccessAllowed"
TypeMessageWebAppDataSent = "messageWebAppDataSent"
TypeMessageWebAppDataReceived = "messageWebAppDataReceived"
TypeMessagePassportDataSent = "messagePassportDataSent"
TypeMessagePassportDataReceived = "messagePassportDataReceived"
TypeMessageProximityAlertTriggered = "messageProximityAlertTriggered"
TypeMessageUnsupported = "messageUnsupported"
TypeTextEntityTypeMention = "textEntityTypeMention"
TypeTextEntityTypeHashtag = "textEntityTypeHashtag"
TypeTextEntityTypeCashtag = "textEntityTypeCashtag"
TypeTextEntityTypeBotCommand = "textEntityTypeBotCommand"
TypeTextEntityTypeUrl = "textEntityTypeUrl"
TypeTextEntityTypeEmailAddress = "textEntityTypeEmailAddress"
TypeTextEntityTypePhoneNumber = "textEntityTypePhoneNumber"
TypeTextEntityTypeBankCardNumber = "textEntityTypeBankCardNumber"
TypeTextEntityTypeBold = "textEntityTypeBold"
TypeTextEntityTypeItalic = "textEntityTypeItalic"
TypeTextEntityTypeUnderline = "textEntityTypeUnderline"
TypeTextEntityTypeStrikethrough = "textEntityTypeStrikethrough"
TypeTextEntityTypeSpoiler = "textEntityTypeSpoiler"
TypeTextEntityTypeCode = "textEntityTypeCode"
TypeTextEntityTypePre = "textEntityTypePre"
TypeTextEntityTypePreCode = "textEntityTypePreCode"
TypeTextEntityTypeTextUrl = "textEntityTypeTextUrl"
TypeTextEntityTypeMentionName = "textEntityTypeMentionName"
TypeTextEntityTypeCustomEmoji = "textEntityTypeCustomEmoji"
TypeTextEntityTypeMediaTimestamp = "textEntityTypeMediaTimestamp"
TypeInputThumbnail = "inputThumbnail"
TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate"
TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline"
TypeMessageSendOptions = "messageSendOptions"
TypeMessageCopyOptions = "messageCopyOptions"
TypeInputMessageText = "inputMessageText"
TypeInputMessageAnimation = "inputMessageAnimation"
TypeInputMessageAudio = "inputMessageAudio"
TypeInputMessageDocument = "inputMessageDocument"
TypeInputMessagePhoto = "inputMessagePhoto"
TypeInputMessageSticker = "inputMessageSticker"
TypeInputMessageVideo = "inputMessageVideo"
TypeInputMessageVideoNote = "inputMessageVideoNote"
TypeInputMessageVoiceNote = "inputMessageVoiceNote"
TypeInputMessageLocation = "inputMessageLocation"
TypeInputMessageVenue = "inputMessageVenue"
TypeInputMessageContact = "inputMessageContact"
TypeInputMessageDice = "inputMessageDice"
TypeInputMessageGame = "inputMessageGame"
TypeInputMessageInvoice = "inputMessageInvoice"
TypeInputMessagePoll = "inputMessagePoll"
TypeInputMessageForwarded = "inputMessageForwarded"
TypeSearchMessagesFilterEmpty = "searchMessagesFilterEmpty"
TypeSearchMessagesFilterAnimation = "searchMessagesFilterAnimation"
TypeSearchMessagesFilterAudio = "searchMessagesFilterAudio"
TypeSearchMessagesFilterDocument = "searchMessagesFilterDocument"
TypeSearchMessagesFilterPhoto = "searchMessagesFilterPhoto"
TypeSearchMessagesFilterVideo = "searchMessagesFilterVideo"
TypeSearchMessagesFilterVoiceNote = "searchMessagesFilterVoiceNote"
TypeSearchMessagesFilterPhotoAndVideo = "searchMessagesFilterPhotoAndVideo"
TypeSearchMessagesFilterUrl = "searchMessagesFilterUrl"
TypeSearchMessagesFilterChatPhoto = "searchMessagesFilterChatPhoto"
TypeSearchMessagesFilterVideoNote = "searchMessagesFilterVideoNote"
TypeSearchMessagesFilterVoiceAndVideoNote = "searchMessagesFilterVoiceAndVideoNote"
TypeSearchMessagesFilterMention = "searchMessagesFilterMention"
TypeSearchMessagesFilterUnreadMention = "searchMessagesFilterUnreadMention"
TypeSearchMessagesFilterUnreadReaction = "searchMessagesFilterUnreadReaction"
TypeSearchMessagesFilterFailedToSend = "searchMessagesFilterFailedToSend"
TypeSearchMessagesFilterPinned = "searchMessagesFilterPinned"
TypeChatActionTyping = "chatActionTyping"
TypeChatActionRecordingVideo = "chatActionRecordingVideo"
TypeChatActionUploadingVideo = "chatActionUploadingVideo"
TypeChatActionRecordingVoiceNote = "chatActionRecordingVoiceNote"
TypeChatActionUploadingVoiceNote = "chatActionUploadingVoiceNote"
TypeChatActionUploadingPhoto = "chatActionUploadingPhoto"
TypeChatActionUploadingDocument = "chatActionUploadingDocument"
TypeChatActionChoosingSticker = "chatActionChoosingSticker"
TypeChatActionChoosingLocation = "chatActionChoosingLocation"
TypeChatActionChoosingContact = "chatActionChoosingContact"
TypeChatActionStartPlayingGame = "chatActionStartPlayingGame"
TypeChatActionRecordingVideoNote = "chatActionRecordingVideoNote"
TypeChatActionUploadingVideoNote = "chatActionUploadingVideoNote"
TypeChatActionWatchingAnimations = "chatActionWatchingAnimations"
TypeChatActionCancel = "chatActionCancel"
TypeUserStatusEmpty = "userStatusEmpty"
TypeUserStatusOnline = "userStatusOnline"
TypeUserStatusOffline = "userStatusOffline"
TypeUserStatusRecently = "userStatusRecently"
TypeUserStatusLastWeek = "userStatusLastWeek"
TypeUserStatusLastMonth = "userStatusLastMonth"
TypeStickers = "stickers"
TypeEmojis = "emojis"
TypeStickerSet = "stickerSet"
TypeStickerSetInfo = "stickerSetInfo"
TypeStickerSets = "stickerSets"
TypeTrendingStickerSets = "trendingStickerSets"
TypeCallDiscardReasonEmpty = "callDiscardReasonEmpty"
TypeCallDiscardReasonMissed = "callDiscardReasonMissed"
TypeCallDiscardReasonDeclined = "callDiscardReasonDeclined"
TypeCallDiscardReasonDisconnected = "callDiscardReasonDisconnected"
TypeCallDiscardReasonHungUp = "callDiscardReasonHungUp"
TypeCallProtocol = "callProtocol"
TypeCallServerTypeTelegramReflector = "callServerTypeTelegramReflector"
TypeCallServerTypeWebrtc = "callServerTypeWebrtc"
TypeCallServer = "callServer"
TypeCallId = "callId"
TypeGroupCallId = "groupCallId"
TypeCallStatePending = "callStatePending"
TypeCallStateExchangingKeys = "callStateExchangingKeys"
TypeCallStateReady = "callStateReady"
TypeCallStateHangingUp = "callStateHangingUp"
TypeCallStateDiscarded = "callStateDiscarded"
TypeCallStateError = "callStateError"
TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail"
TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium"
TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull"
TypeGroupCallStream = "groupCallStream"
TypeGroupCallStreams = "groupCallStreams"
TypeRtmpUrl = "rtmpUrl"
TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker"
TypeGroupCall = "groupCall"
TypeGroupCallVideoSourceGroup = "groupCallVideoSourceGroup"
TypeGroupCallParticipantVideoInfo = "groupCallParticipantVideoInfo"
TypeGroupCallParticipant = "groupCallParticipant"
TypeCallProblemEcho = "callProblemEcho"
TypeCallProblemNoise = "callProblemNoise"
TypeCallProblemInterruptions = "callProblemInterruptions"
TypeCallProblemDistortedSpeech = "callProblemDistortedSpeech"
TypeCallProblemSilentLocal = "callProblemSilentLocal"
TypeCallProblemSilentRemote = "callProblemSilentRemote"
TypeCallProblemDropped = "callProblemDropped"
TypeCallProblemDistortedVideo = "callProblemDistortedVideo"
TypeCallProblemPixelatedVideo = "callProblemPixelatedVideo"
TypeCall = "call"
TypePhoneNumberAuthenticationSettings = "phoneNumberAuthenticationSettings"
TypeAddedReaction = "addedReaction"
TypeAddedReactions = "addedReactions"
TypeAvailableReaction = "availableReaction"
TypeAvailableReactions = "availableReactions"
TypeEmojiReaction = "emojiReaction"
TypeAnimations = "animations"
TypeDiceStickersRegular = "diceStickersRegular"
TypeDiceStickersSlotMachine = "diceStickersSlotMachine"
TypeImportedContacts = "importedContacts"
TypeSpeechRecognitionResultPending = "speechRecognitionResultPending"
TypeSpeechRecognitionResultText = "speechRecognitionResultText"
TypeSpeechRecognitionResultError = "speechRecognitionResultError"
TypeAttachmentMenuBotColor = "attachmentMenuBotColor"
TypeAttachmentMenuBot = "attachmentMenuBot"
TypeSentWebAppMessage = "sentWebAppMessage"
TypeHttpUrl = "httpUrl"
TypeUserLink = "userLink"
TypeInputInlineQueryResultAnimation = "inputInlineQueryResultAnimation"
TypeInputInlineQueryResultArticle = "inputInlineQueryResultArticle"
TypeInputInlineQueryResultAudio = "inputInlineQueryResultAudio"
TypeInputInlineQueryResultContact = "inputInlineQueryResultContact"
TypeInputInlineQueryResultDocument = "inputInlineQueryResultDocument"
TypeInputInlineQueryResultGame = "inputInlineQueryResultGame"
TypeInputInlineQueryResultLocation = "inputInlineQueryResultLocation"
TypeInputInlineQueryResultPhoto = "inputInlineQueryResultPhoto"
TypeInputInlineQueryResultSticker = "inputInlineQueryResultSticker"
TypeInputInlineQueryResultVenue = "inputInlineQueryResultVenue"
TypeInputInlineQueryResultVideo = "inputInlineQueryResultVideo"
TypeInputInlineQueryResultVoiceNote = "inputInlineQueryResultVoiceNote"
TypeInlineQueryResultArticle = "inlineQueryResultArticle"
TypeInlineQueryResultContact = "inlineQueryResultContact"
TypeInlineQueryResultLocation = "inlineQueryResultLocation"
TypeInlineQueryResultVenue = "inlineQueryResultVenue"
TypeInlineQueryResultGame = "inlineQueryResultGame"
TypeInlineQueryResultAnimation = "inlineQueryResultAnimation"
TypeInlineQueryResultAudio = "inlineQueryResultAudio"
TypeInlineQueryResultDocument = "inlineQueryResultDocument"
TypeInlineQueryResultPhoto = "inlineQueryResultPhoto"
TypeInlineQueryResultSticker = "inlineQueryResultSticker"
TypeInlineQueryResultVideo = "inlineQueryResultVideo"
TypeInlineQueryResultVoiceNote = "inlineQueryResultVoiceNote"
TypeInlineQueryResults = "inlineQueryResults"
TypeCallbackQueryPayloadData = "callbackQueryPayloadData"
TypeCallbackQueryPayloadDataWithPassword = "callbackQueryPayloadDataWithPassword"
TypeCallbackQueryPayloadGame = "callbackQueryPayloadGame"
TypeCallbackQueryAnswer = "callbackQueryAnswer"
TypeCustomRequestResult = "customRequestResult"
TypeGameHighScore = "gameHighScore"
TypeGameHighScores = "gameHighScores"
TypeChatEventMessageEdited = "chatEventMessageEdited"
TypeChatEventMessageDeleted = "chatEventMessageDeleted"
TypeChatEventMessagePinned = "chatEventMessagePinned"
TypeChatEventMessageUnpinned = "chatEventMessageUnpinned"
TypeChatEventPollStopped = "chatEventPollStopped"
TypeChatEventMemberJoined = "chatEventMemberJoined"
TypeChatEventMemberJoinedByInviteLink = "chatEventMemberJoinedByInviteLink"
TypeChatEventMemberJoinedByRequest = "chatEventMemberJoinedByRequest"
TypeChatEventMemberInvited = "chatEventMemberInvited"
TypeChatEventMemberLeft = "chatEventMemberLeft"
TypeChatEventMemberPromoted = "chatEventMemberPromoted"
TypeChatEventMemberRestricted = "chatEventMemberRestricted"
TypeChatEventAvailableReactionsChanged = "chatEventAvailableReactionsChanged"
TypeChatEventDescriptionChanged = "chatEventDescriptionChanged"
TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged"
TypeChatEventLocationChanged = "chatEventLocationChanged"
TypeChatEventMessageAutoDeleteTimeChanged = "chatEventMessageAutoDeleteTimeChanged"
TypeChatEventPermissionsChanged = "chatEventPermissionsChanged"
TypeChatEventPhotoChanged = "chatEventPhotoChanged"
TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged"
TypeChatEventStickerSetChanged = "chatEventStickerSetChanged"
TypeChatEventTitleChanged = "chatEventTitleChanged"
TypeChatEventUsernameChanged = "chatEventUsernameChanged"
TypeChatEventActiveUsernamesChanged = "chatEventActiveUsernamesChanged"
TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled"
TypeChatEventInvitesToggled = "chatEventInvitesToggled"
TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled"
TypeChatEventHasAggressiveAntiSpamEnabledToggled = "chatEventHasAggressiveAntiSpamEnabledToggled"
TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled"
TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited"
TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked"
TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted"
TypeChatEventVideoChatCreated = "chatEventVideoChatCreated"
TypeChatEventVideoChatEnded = "chatEventVideoChatEnded"
TypeChatEventVideoChatMuteNewParticipantsToggled = "chatEventVideoChatMuteNewParticipantsToggled"
TypeChatEventVideoChatParticipantIsMutedToggled = "chatEventVideoChatParticipantIsMutedToggled"
TypeChatEventVideoChatParticipantVolumeLevelChanged = "chatEventVideoChatParticipantVolumeLevelChanged"
TypeChatEventIsForumToggled = "chatEventIsForumToggled"
TypeChatEventForumTopicCreated = "chatEventForumTopicCreated"
TypeChatEventForumTopicEdited = "chatEventForumTopicEdited"
TypeChatEventForumTopicToggleIsClosed = "chatEventForumTopicToggleIsClosed"
TypeChatEventForumTopicToggleIsHidden = "chatEventForumTopicToggleIsHidden"
TypeChatEventForumTopicDeleted = "chatEventForumTopicDeleted"
TypeChatEventForumTopicPinned = "chatEventForumTopicPinned"
TypeChatEvent = "chatEvent"
TypeChatEvents = "chatEvents"
TypeChatEventLogFilters = "chatEventLogFilters"
TypeLanguagePackStringValueOrdinary = "languagePackStringValueOrdinary"
TypeLanguagePackStringValuePluralized = "languagePackStringValuePluralized"
TypeLanguagePackStringValueDeleted = "languagePackStringValueDeleted"
TypeLanguagePackString = "languagePackString"
TypeLanguagePackStrings = "languagePackStrings"
TypeLanguagePackInfo = "languagePackInfo"
TypeLocalizationTargetInfo = "localizationTargetInfo"
TypePremiumLimitTypeSupergroupCount = "premiumLimitTypeSupergroupCount"
TypePremiumLimitTypePinnedChatCount = "premiumLimitTypePinnedChatCount"
TypePremiumLimitTypeCreatedPublicChatCount = "premiumLimitTypeCreatedPublicChatCount"
TypePremiumLimitTypeSavedAnimationCount = "premiumLimitTypeSavedAnimationCount"
TypePremiumLimitTypeFavoriteStickerCount = "premiumLimitTypeFavoriteStickerCount"
TypePremiumLimitTypeChatFilterCount = "premiumLimitTypeChatFilterCount"
TypePremiumLimitTypeChatFilterChosenChatCount = "premiumLimitTypeChatFilterChosenChatCount"
TypePremiumLimitTypePinnedArchivedChatCount = "premiumLimitTypePinnedArchivedChatCount"
TypePremiumLimitTypeCaptionLength = "premiumLimitTypeCaptionLength"
TypePremiumLimitTypeBioLength = "premiumLimitTypeBioLength"
TypePremiumFeatureIncreasedLimits = "premiumFeatureIncreasedLimits"
TypePremiumFeatureIncreasedUploadFileSize = "premiumFeatureIncreasedUploadFileSize"
TypePremiumFeatureImprovedDownloadSpeed = "premiumFeatureImprovedDownloadSpeed"
TypePremiumFeatureVoiceRecognition = "premiumFeatureVoiceRecognition"
TypePremiumFeatureDisabledAds = "premiumFeatureDisabledAds"
TypePremiumFeatureUniqueReactions = "premiumFeatureUniqueReactions"
TypePremiumFeatureUniqueStickers = "premiumFeatureUniqueStickers"
TypePremiumFeatureCustomEmoji = "premiumFeatureCustomEmoji"
TypePremiumFeatureAdvancedChatManagement = "premiumFeatureAdvancedChatManagement"
TypePremiumFeatureProfileBadge = "premiumFeatureProfileBadge"
TypePremiumFeatureEmojiStatus = "premiumFeatureEmojiStatus"
TypePremiumFeatureAnimatedProfilePhoto = "premiumFeatureAnimatedProfilePhoto"
TypePremiumFeatureForumTopicIcon = "premiumFeatureForumTopicIcon"
TypePremiumFeatureAppIcons = "premiumFeatureAppIcons"
TypePremiumLimit = "premiumLimit"
TypePremiumFeatures = "premiumFeatures"
TypePremiumSourceLimitExceeded = "premiumSourceLimitExceeded"
TypePremiumSourceFeature = "premiumSourceFeature"
TypePremiumSourceLink = "premiumSourceLink"
TypePremiumSourceSettings = "premiumSourceSettings"
TypePremiumFeaturePromotionAnimation = "premiumFeaturePromotionAnimation"
TypePremiumState = "premiumState"
TypeStorePaymentPurposePremiumSubscription = "storePaymentPurposePremiumSubscription"
TypeStorePaymentPurposeGiftedPremium = "storePaymentPurposeGiftedPremium"
TypeDeviceTokenFirebaseCloudMessaging = "deviceTokenFirebaseCloudMessaging"
TypeDeviceTokenApplePush = "deviceTokenApplePush"
TypeDeviceTokenApplePushVoIP = "deviceTokenApplePushVoIP"
TypeDeviceTokenWindowsPush = "deviceTokenWindowsPush"
TypeDeviceTokenMicrosoftPush = "deviceTokenMicrosoftPush"
TypeDeviceTokenMicrosoftPushVoIP = "deviceTokenMicrosoftPushVoIP"
TypeDeviceTokenWebPush = "deviceTokenWebPush"
TypeDeviceTokenSimplePush = "deviceTokenSimplePush"
TypeDeviceTokenUbuntuPush = "deviceTokenUbuntuPush"
TypeDeviceTokenBlackBerryPush = "deviceTokenBlackBerryPush"
TypeDeviceTokenTizenPush = "deviceTokenTizenPush"
TypePushReceiverId = "pushReceiverId"
TypeBackgroundFillSolid = "backgroundFillSolid"
TypeBackgroundFillGradient = "backgroundFillGradient"
TypeBackgroundFillFreeformGradient = "backgroundFillFreeformGradient"
TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper"
TypeBackgroundTypePattern = "backgroundTypePattern"
TypeBackgroundTypeFill = "backgroundTypeFill"
TypeBackground = "background"
TypeBackgrounds = "backgrounds"
TypeInputBackgroundLocal = "inputBackgroundLocal"
TypeInputBackgroundRemote = "inputBackgroundRemote"
TypeThemeSettings = "themeSettings"
TypeChatTheme = "chatTheme"
TypeHashtags = "hashtags"
TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk"
TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded"
TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh"
TypeCanTransferOwnershipResultSessionTooFresh = "canTransferOwnershipResultSessionTooFresh"
TypeCheckChatUsernameResultOk = "checkChatUsernameResultOk"
TypeCheckChatUsernameResultUsernameInvalid = "checkChatUsernameResultUsernameInvalid"
TypeCheckChatUsernameResultUsernameOccupied = "checkChatUsernameResultUsernameOccupied"
TypeCheckChatUsernameResultUsernamePurchasable = "checkChatUsernameResultUsernamePurchasable"
TypeCheckChatUsernameResultPublicChatsTooMany = "checkChatUsernameResultPublicChatsTooMany"
TypeCheckChatUsernameResultPublicGroupsUnavailable = "checkChatUsernameResultPublicGroupsUnavailable"
TypeCheckStickerSetNameResultOk = "checkStickerSetNameResultOk"
TypeCheckStickerSetNameResultNameInvalid = "checkStickerSetNameResultNameInvalid"
TypeCheckStickerSetNameResultNameOccupied = "checkStickerSetNameResultNameOccupied"
TypeResetPasswordResultOk = "resetPasswordResultOk"
TypeResetPasswordResultPending = "resetPasswordResultPending"
TypeResetPasswordResultDeclined = "resetPasswordResultDeclined"
TypeMessageFileTypePrivate = "messageFileTypePrivate"
TypeMessageFileTypeGroup = "messageFileTypeGroup"
TypeMessageFileTypeUnknown = "messageFileTypeUnknown"
TypePushMessageContentHidden = "pushMessageContentHidden"
TypePushMessageContentAnimation = "pushMessageContentAnimation"
TypePushMessageContentAudio = "pushMessageContentAudio"
TypePushMessageContentContact = "pushMessageContentContact"
TypePushMessageContentContactRegistered = "pushMessageContentContactRegistered"
TypePushMessageContentDocument = "pushMessageContentDocument"
TypePushMessageContentGame = "pushMessageContentGame"
TypePushMessageContentGameScore = "pushMessageContentGameScore"
TypePushMessageContentInvoice = "pushMessageContentInvoice"
TypePushMessageContentLocation = "pushMessageContentLocation"
TypePushMessageContentPhoto = "pushMessageContentPhoto"
TypePushMessageContentPoll = "pushMessageContentPoll"
TypePushMessageContentScreenshotTaken = "pushMessageContentScreenshotTaken"
TypePushMessageContentSticker = "pushMessageContentSticker"
TypePushMessageContentText = "pushMessageContentText"
TypePushMessageContentVideo = "pushMessageContentVideo"
TypePushMessageContentVideoNote = "pushMessageContentVideoNote"
TypePushMessageContentVoiceNote = "pushMessageContentVoiceNote"
TypePushMessageContentBasicGroupChatCreate = "pushMessageContentBasicGroupChatCreate"
TypePushMessageContentChatAddMembers = "pushMessageContentChatAddMembers"
TypePushMessageContentChatChangePhoto = "pushMessageContentChatChangePhoto"
TypePushMessageContentChatChangeTitle = "pushMessageContentChatChangeTitle"
TypePushMessageContentChatSetTheme = "pushMessageContentChatSetTheme"
TypePushMessageContentChatDeleteMember = "pushMessageContentChatDeleteMember"
TypePushMessageContentChatJoinByLink = "pushMessageContentChatJoinByLink"
TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest"
TypePushMessageContentRecurringPayment = "pushMessageContentRecurringPayment"
TypePushMessageContentSuggestProfilePhoto = "pushMessageContentSuggestProfilePhoto"
TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards"
TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum"
TypeNotificationTypeNewMessage = "notificationTypeNewMessage"
TypeNotificationTypeNewSecretChat = "notificationTypeNewSecretChat"
TypeNotificationTypeNewCall = "notificationTypeNewCall"
TypeNotificationTypeNewPushMessage = "notificationTypeNewPushMessage"
TypeNotificationGroupTypeMessages = "notificationGroupTypeMessages"
TypeNotificationGroupTypeMentions = "notificationGroupTypeMentions"
TypeNotificationGroupTypeSecretChat = "notificationGroupTypeSecretChat"
TypeNotificationGroupTypeCalls = "notificationGroupTypeCalls"
TypeNotificationSound = "notificationSound"
TypeNotificationSounds = "notificationSounds"
TypeNotification = "notification"
TypeNotificationGroup = "notificationGroup"
TypeOptionValueBoolean = "optionValueBoolean"
TypeOptionValueEmpty = "optionValueEmpty"
TypeOptionValueInteger = "optionValueInteger"
TypeOptionValueString = "optionValueString"
TypeJsonObjectMember = "jsonObjectMember"
TypeJsonValueNull = "jsonValueNull"
TypeJsonValueBoolean = "jsonValueBoolean"
TypeJsonValueNumber = "jsonValueNumber"
TypeJsonValueString = "jsonValueString"
TypeJsonValueArray = "jsonValueArray"
TypeJsonValueObject = "jsonValueObject"
TypeUserPrivacySettingRuleAllowAll = "userPrivacySettingRuleAllowAll"
TypeUserPrivacySettingRuleAllowContacts = "userPrivacySettingRuleAllowContacts"
TypeUserPrivacySettingRuleAllowUsers = "userPrivacySettingRuleAllowUsers"
TypeUserPrivacySettingRuleAllowChatMembers = "userPrivacySettingRuleAllowChatMembers"
TypeUserPrivacySettingRuleRestrictAll = "userPrivacySettingRuleRestrictAll"
TypeUserPrivacySettingRuleRestrictContacts = "userPrivacySettingRuleRestrictContacts"
TypeUserPrivacySettingRuleRestrictUsers = "userPrivacySettingRuleRestrictUsers"
TypeUserPrivacySettingRuleRestrictChatMembers = "userPrivacySettingRuleRestrictChatMembers"
TypeUserPrivacySettingRules = "userPrivacySettingRules"
TypeUserPrivacySettingShowStatus = "userPrivacySettingShowStatus"
TypeUserPrivacySettingShowProfilePhoto = "userPrivacySettingShowProfilePhoto"
TypeUserPrivacySettingShowLinkInForwardedMessages = "userPrivacySettingShowLinkInForwardedMessages"
TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber"
TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites"
TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls"
TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls"
TypeUserPrivacySettingAllowFindingByPhoneNumber = "userPrivacySettingAllowFindingByPhoneNumber"
TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages"
TypeAccountTtl = "accountTtl"
TypeMessageAutoDeleteTime = "messageAutoDeleteTime"
TypeSessionTypeAndroid = "sessionTypeAndroid"
TypeSessionTypeApple = "sessionTypeApple"
TypeSessionTypeBrave = "sessionTypeBrave"
TypeSessionTypeChrome = "sessionTypeChrome"
TypeSessionTypeEdge = "sessionTypeEdge"
TypeSessionTypeFirefox = "sessionTypeFirefox"
TypeSessionTypeIpad = "sessionTypeIpad"
TypeSessionTypeIphone = "sessionTypeIphone"
TypeSessionTypeLinux = "sessionTypeLinux"
TypeSessionTypeMac = "sessionTypeMac"
TypeSessionTypeOpera = "sessionTypeOpera"
TypeSessionTypeSafari = "sessionTypeSafari"
TypeSessionTypeUbuntu = "sessionTypeUbuntu"
TypeSessionTypeUnknown = "sessionTypeUnknown"
TypeSessionTypeVivaldi = "sessionTypeVivaldi"
TypeSessionTypeWindows = "sessionTypeWindows"
TypeSessionTypeXbox = "sessionTypeXbox"
TypeSession = "session"
TypeSessions = "sessions"
TypeConnectedWebsite = "connectedWebsite"
TypeConnectedWebsites = "connectedWebsites"
TypeChatReportReasonSpam = "chatReportReasonSpam"
TypeChatReportReasonViolence = "chatReportReasonViolence"
TypeChatReportReasonPornography = "chatReportReasonPornography"
TypeChatReportReasonChildAbuse = "chatReportReasonChildAbuse"
TypeChatReportReasonCopyright = "chatReportReasonCopyright"
TypeChatReportReasonUnrelatedLocation = "chatReportReasonUnrelatedLocation"
TypeChatReportReasonFake = "chatReportReasonFake"
TypeChatReportReasonIllegalDrugs = "chatReportReasonIllegalDrugs"
TypeChatReportReasonPersonalDetails = "chatReportReasonPersonalDetails"
TypeChatReportReasonCustom = "chatReportReasonCustom"
TypeTargetChatCurrent = "targetChatCurrent"
TypeTargetChatChosen = "targetChatChosen"
TypeTargetChatInternalLink = "targetChatInternalLink"
TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions"
TypeInternalLinkTypeAttachmentMenuBot = "internalLinkTypeAttachmentMenuBot"
TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode"
TypeInternalLinkTypeBackground = "internalLinkTypeBackground"
TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart"
TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup"
TypeInternalLinkTypeBotAddToChannel = "internalLinkTypeBotAddToChannel"
TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber"
TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite"
TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings"
TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings"
TypeInternalLinkTypeFilterSettings = "internalLinkTypeFilterSettings"
TypeInternalLinkTypeGame = "internalLinkTypeGame"
TypeInternalLinkTypeInstantView = "internalLinkTypeInstantView"
TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice"
TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack"
TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings"
TypeInternalLinkTypeMessage = "internalLinkTypeMessage"
TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft"
TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest"
TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation"
TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures"
TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings"
TypeInternalLinkTypeProxy = "internalLinkTypeProxy"
TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat"
TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication"
TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases"
TypeInternalLinkTypeSettings = "internalLinkTypeSettings"
TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet"
TypeInternalLinkTypeTheme = "internalLinkTypeTheme"
TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings"
TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink"
TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy"
TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber"
TypeInternalLinkTypeUserToken = "internalLinkTypeUserToken"
TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat"
TypeMessageLink = "messageLink"
TypeMessageLinkInfo = "messageLinkInfo"
TypeFilePart = "filePart"
TypeFileTypeNone = "fileTypeNone"
TypeFileTypeAnimation = "fileTypeAnimation"
TypeFileTypeAudio = "fileTypeAudio"
TypeFileTypeDocument = "fileTypeDocument"
TypeFileTypeNotificationSound = "fileTypeNotificationSound"
TypeFileTypePhoto = "fileTypePhoto"
TypeFileTypeProfilePhoto = "fileTypeProfilePhoto"
TypeFileTypeSecret = "fileTypeSecret"
TypeFileTypeSecretThumbnail = "fileTypeSecretThumbnail"
TypeFileTypeSecure = "fileTypeSecure"
TypeFileTypeSticker = "fileTypeSticker"
TypeFileTypeThumbnail = "fileTypeThumbnail"
TypeFileTypeUnknown = "fileTypeUnknown"
TypeFileTypeVideo = "fileTypeVideo"
TypeFileTypeVideoNote = "fileTypeVideoNote"
TypeFileTypeVoiceNote = "fileTypeVoiceNote"
TypeFileTypeWallpaper = "fileTypeWallpaper"
TypeStorageStatisticsByFileType = "storageStatisticsByFileType"
TypeStorageStatisticsByChat = "storageStatisticsByChat"
TypeStorageStatistics = "storageStatistics"
TypeStorageStatisticsFast = "storageStatisticsFast"
TypeDatabaseStatistics = "databaseStatistics"
TypeNetworkTypeNone = "networkTypeNone"
TypeNetworkTypeMobile = "networkTypeMobile"
TypeNetworkTypeMobileRoaming = "networkTypeMobileRoaming"
TypeNetworkTypeWiFi = "networkTypeWiFi"
TypeNetworkTypeOther = "networkTypeOther"
TypeNetworkStatisticsEntryFile = "networkStatisticsEntryFile"
TypeNetworkStatisticsEntryCall = "networkStatisticsEntryCall"
TypeNetworkStatistics = "networkStatistics"
TypeAutoDownloadSettings = "autoDownloadSettings"
TypeAutoDownloadSettingsPresets = "autoDownloadSettingsPresets"
TypeConnectionStateWaitingForNetwork = "connectionStateWaitingForNetwork"
TypeConnectionStateConnectingToProxy = "connectionStateConnectingToProxy"
TypeConnectionStateConnecting = "connectionStateConnecting"
TypeConnectionStateUpdating = "connectionStateUpdating"
TypeConnectionStateReady = "connectionStateReady"
TypeTopChatCategoryUsers = "topChatCategoryUsers"
TypeTopChatCategoryBots = "topChatCategoryBots"
TypeTopChatCategoryGroups = "topChatCategoryGroups"
TypeTopChatCategoryChannels = "topChatCategoryChannels"
TypeTopChatCategoryInlineBots = "topChatCategoryInlineBots"
TypeTopChatCategoryCalls = "topChatCategoryCalls"
TypeTopChatCategoryForwardChats = "topChatCategoryForwardChats"
TypeTMeUrlTypeUser = "tMeUrlTypeUser"
TypeTMeUrlTypeSupergroup = "tMeUrlTypeSupergroup"
TypeTMeUrlTypeChatInvite = "tMeUrlTypeChatInvite"
TypeTMeUrlTypeStickerSet = "tMeUrlTypeStickerSet"
TypeTMeUrl = "tMeUrl"
TypeTMeUrls = "tMeUrls"
TypeSuggestedActionEnableArchiveAndMuteNewChats = "suggestedActionEnableArchiveAndMuteNewChats"
TypeSuggestedActionCheckPassword = "suggestedActionCheckPassword"
TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber"
TypeSuggestedActionViewChecksHint = "suggestedActionViewChecksHint"
TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup"
TypeSuggestedActionSetPassword = "suggestedActionSetPassword"
TypeCount = "count"
TypeText = "text"
TypeSeconds = "seconds"
TypeFileDownloadedPrefixSize = "fileDownloadedPrefixSize"
TypeDeepLinkInfo = "deepLinkInfo"
TypeTextParseModeMarkdown = "textParseModeMarkdown"
TypeTextParseModeHTML = "textParseModeHTML"
TypeProxyTypeSocks5 = "proxyTypeSocks5"
TypeProxyTypeHttp = "proxyTypeHttp"
TypeProxyTypeMtproto = "proxyTypeMtproto"
TypeProxy = "proxy"
TypeProxies = "proxies"
TypeInputSticker = "inputSticker"
TypeDateRange = "dateRange"
TypeStatisticalValue = "statisticalValue"
TypeStatisticalGraphData = "statisticalGraphData"
TypeStatisticalGraphAsync = "statisticalGraphAsync"
TypeStatisticalGraphError = "statisticalGraphError"
TypeChatStatisticsMessageInteractionInfo = "chatStatisticsMessageInteractionInfo"
TypeChatStatisticsMessageSenderInfo = "chatStatisticsMessageSenderInfo"
TypeChatStatisticsAdministratorActionsInfo = "chatStatisticsAdministratorActionsInfo"
TypeChatStatisticsInviterInfo = "chatStatisticsInviterInfo"
TypeChatStatisticsSupergroup = "chatStatisticsSupergroup"
TypeChatStatisticsChannel = "chatStatisticsChannel"
TypeMessageStatistics = "messageStatistics"
TypePoint = "point"
TypeVectorPathCommandLine = "vectorPathCommandLine"
TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve"
TypeBotCommandScopeDefault = "botCommandScopeDefault"
TypeBotCommandScopeAllPrivateChats = "botCommandScopeAllPrivateChats"
TypeBotCommandScopeAllGroupChats = "botCommandScopeAllGroupChats"
TypeBotCommandScopeAllChatAdministrators = "botCommandScopeAllChatAdministrators"
TypeBotCommandScopeChat = "botCommandScopeChat"
TypeBotCommandScopeChatAdministrators = "botCommandScopeChatAdministrators"
TypeBotCommandScopeChatMember = "botCommandScopeChatMember"
TypeUpdateAuthorizationState = "updateAuthorizationState"
TypeUpdateNewMessage = "updateNewMessage"
TypeUpdateMessageSendAcknowledged = "updateMessageSendAcknowledged"
TypeUpdateMessageSendSucceeded = "updateMessageSendSucceeded"
TypeUpdateMessageSendFailed = "updateMessageSendFailed"
TypeUpdateMessageContent = "updateMessageContent"
TypeUpdateMessageEdited = "updateMessageEdited"
TypeUpdateMessageIsPinned = "updateMessageIsPinned"
TypeUpdateMessageInteractionInfo = "updateMessageInteractionInfo"
TypeUpdateMessageContentOpened = "updateMessageContentOpened"
TypeUpdateMessageMentionRead = "updateMessageMentionRead"
TypeUpdateMessageUnreadReactions = "updateMessageUnreadReactions"
TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed"
TypeUpdateNewChat = "updateNewChat"
TypeUpdateChatTitle = "updateChatTitle"
TypeUpdateChatPhoto = "updateChatPhoto"
TypeUpdateChatPermissions = "updateChatPermissions"
TypeUpdateChatLastMessage = "updateChatLastMessage"
TypeUpdateChatPosition = "updateChatPosition"
TypeUpdateChatReadInbox = "updateChatReadInbox"
TypeUpdateChatReadOutbox = "updateChatReadOutbox"
TypeUpdateChatActionBar = "updateChatActionBar"
TypeUpdateChatAvailableReactions = "updateChatAvailableReactions"
TypeUpdateChatDraftMessage = "updateChatDraftMessage"
TypeUpdateChatMessageSender = "updateChatMessageSender"
TypeUpdateChatMessageAutoDeleteTime = "updateChatMessageAutoDeleteTime"
TypeUpdateChatNotificationSettings = "updateChatNotificationSettings"
TypeUpdateChatPendingJoinRequests = "updateChatPendingJoinRequests"
TypeUpdateChatReplyMarkup = "updateChatReplyMarkup"
TypeUpdateChatTheme = "updateChatTheme"
TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount"
TypeUpdateChatUnreadReactionCount = "updateChatUnreadReactionCount"
TypeUpdateChatVideoChat = "updateChatVideoChat"
TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification"
TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent"
TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages"
TypeUpdateChatIsBlocked = "updateChatIsBlocked"
TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread"
TypeUpdateChatFilters = "updateChatFilters"
TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount"
TypeUpdateForumTopicInfo = "updateForumTopicInfo"
TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings"
TypeUpdateNotification = "updateNotification"
TypeUpdateNotificationGroup = "updateNotificationGroup"
TypeUpdateActiveNotifications = "updateActiveNotifications"
TypeUpdateHavePendingNotifications = "updateHavePendingNotifications"
TypeUpdateDeleteMessages = "updateDeleteMessages"
TypeUpdateChatAction = "updateChatAction"
TypeUpdateUserStatus = "updateUserStatus"
TypeUpdateUser = "updateUser"
TypeUpdateBasicGroup = "updateBasicGroup"
TypeUpdateSupergroup = "updateSupergroup"
TypeUpdateSecretChat = "updateSecretChat"
TypeUpdateUserFullInfo = "updateUserFullInfo"
TypeUpdateBasicGroupFullInfo = "updateBasicGroupFullInfo"
TypeUpdateSupergroupFullInfo = "updateSupergroupFullInfo"
TypeUpdateServiceNotification = "updateServiceNotification"
TypeUpdateFile = "updateFile"
TypeUpdateFileGenerationStart = "updateFileGenerationStart"
TypeUpdateFileGenerationStop = "updateFileGenerationStop"
TypeUpdateFileDownloads = "updateFileDownloads"
TypeUpdateFileAddedToDownloads = "updateFileAddedToDownloads"
TypeUpdateFileDownload = "updateFileDownload"
TypeUpdateFileRemovedFromDownloads = "updateFileRemovedFromDownloads"
TypeUpdateCall = "updateCall"
TypeUpdateGroupCall = "updateGroupCall"
TypeUpdateGroupCallParticipant = "updateGroupCallParticipant"
TypeUpdateNewCallSignalingData = "updateNewCallSignalingData"
TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules"
TypeUpdateUnreadMessageCount = "updateUnreadMessageCount"
TypeUpdateUnreadChatCount = "updateUnreadChatCount"
TypeUpdateOption = "updateOption"
TypeUpdateStickerSet = "updateStickerSet"
TypeUpdateInstalledStickerSets = "updateInstalledStickerSets"
TypeUpdateTrendingStickerSets = "updateTrendingStickerSets"
TypeUpdateRecentStickers = "updateRecentStickers"
TypeUpdateFavoriteStickers = "updateFavoriteStickers"
TypeUpdateSavedAnimations = "updateSavedAnimations"
TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds"
TypeUpdateSelectedBackground = "updateSelectedBackground"
TypeUpdateChatThemes = "updateChatThemes"
TypeUpdateLanguagePackStrings = "updateLanguagePackStrings"
TypeUpdateConnectionState = "updateConnectionState"
TypeUpdateTermsOfService = "updateTermsOfService"
TypeUpdateUsersNearby = "updateUsersNearby"
TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots"
TypeUpdateWebAppMessageSent = "updateWebAppMessageSent"
TypeUpdateActiveEmojiReactions = "updateActiveEmojiReactions"
TypeUpdateDefaultReactionType = "updateDefaultReactionType"
TypeUpdateDiceEmojis = "updateDiceEmojis"
TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked"
TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters"
TypeUpdateSuggestedActions = "updateSuggestedActions"
TypeUpdateNewInlineQuery = "updateNewInlineQuery"
TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult"
TypeUpdateNewCallbackQuery = "updateNewCallbackQuery"
TypeUpdateNewInlineCallbackQuery = "updateNewInlineCallbackQuery"
TypeUpdateNewShippingQuery = "updateNewShippingQuery"
TypeUpdateNewPreCheckoutQuery = "updateNewPreCheckoutQuery"
TypeUpdateNewCustomEvent = "updateNewCustomEvent"
TypeUpdateNewCustomQuery = "updateNewCustomQuery"
TypeUpdatePoll = "updatePoll"
TypeUpdatePollAnswer = "updatePollAnswer"
TypeUpdateChatMember = "updateChatMember"
TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest"
TypeUpdates = "updates"
TypeLogStreamDefault = "logStreamDefault"
TypeLogStreamFile = "logStreamFile"
TypeLogStreamEmpty = "logStreamEmpty"
TypeLogVerbosityLevel = "logVerbosityLevel"
TypeLogTags = "logTags"
TypeUserSupportInfo = "userSupportInfo"
TypeTestInt = "testInt"
TypeTestString = "testString"
TypeTestBytes = "testBytes"
TypeTestVectorInt = "testVectorInt"
TypeTestVectorIntObject = "testVectorIntObject"
TypeTestVectorString = "testVectorString"
TypeTestVectorStringObject = "testVectorStringObject"
2021-10-22 16:24:12 +02:00
)
// Provides information about the method by which an authentication code is delivered to the user
type AuthenticationCodeType interface {
AuthenticationCodeTypeType() string
}
2023-06-04 22:58:07 +02:00
// Contains authentication data for a email address
type EmailAddressAuthentication interface {
EmailAddressAuthenticationType() string
}
2021-10-22 16:24:12 +02:00
// Represents the current authorization state of the TDLib client
type AuthorizationState interface {
AuthorizationStateType() string
}
// Points to a file
type InputFile interface {
InputFileType() string
}
2023-06-04 22:58:07 +02:00
// Describes format of a thumbnail
2021-10-22 16:24:12 +02:00
type ThumbnailFormat interface {
ThumbnailFormatType() string
}
2021-12-08 10:23:00 +01:00
// Part of the face, relative to which a mask is placed
2021-10-22 16:24:12 +02:00
type MaskPoint interface {
MaskPointType() string
}
2023-06-04 22:58:07 +02:00
// Describes format of a sticker
type StickerFormat interface {
StickerFormatType() string
}
// Describes type of a sticker
type StickerType interface {
StickerTypeType() string
}
// Contains full information about sticker type
type StickerFullType interface {
StickerFullTypeType() string
}
2021-10-22 16:24:12 +02:00
// Describes the type of a poll
type PollType interface {
PollTypeType() string
}
// Represents the type of a user. The following types are possible: regular users, deleted users and bots
type UserType interface {
UserTypeType() string
}
// Describes a photo to be set as a user profile or chat photo
type InputChatPhoto interface {
InputChatPhotoType() string
}
// Provides information about the status of a member in a chat
type ChatMemberStatus interface {
ChatMemberStatusType() string
}
// Specifies the kind of chat members to return in searchChatMembers
type ChatMembersFilter interface {
ChatMembersFilterType() string
}
// Specifies the kind of chat members to return in getSupergroupMembers
type SupergroupMembersFilter interface {
SupergroupMembersFilterType() string
}
// Describes the current secret chat state
type SecretChatState interface {
SecretChatStateType() string
}
// Contains information about the sender of a message
type MessageSender interface {
MessageSenderType() string
}
// Contains information about the origin of a forwarded message
type MessageForwardOrigin interface {
MessageForwardOriginType() string
}
2023-06-04 22:58:07 +02:00
// Describes type of message reaction
type ReactionType interface {
ReactionTypeType() string
}
2021-10-22 16:24:12 +02:00
// Contains information about the sending state of the message
type MessageSendingState interface {
MessageSendingStateType() string
}
2021-12-08 10:23:00 +01:00
// Describes the types of chats to which notification settings are relevant
2021-10-22 16:24:12 +02:00
type NotificationSettingsScope interface {
NotificationSettingsScopeType() string
}
// Describes the type of a chat
type ChatType interface {
ChatTypeType() string
}
// Describes a list of chats
type ChatList interface {
ChatListType() string
}
// Describes a reason why an external chat is shown in a chat list
type ChatSource interface {
ChatSourceType() string
}
2023-06-04 22:58:07 +02:00
// Describes reactions available in the chat
type ChatAvailableReactions interface {
ChatAvailableReactionsType() string
}
2021-10-22 16:24:12 +02:00
// Describes a type of public chats
type PublicChatType interface {
PublicChatTypeType() string
}
2021-12-08 10:23:00 +01:00
// Describes actions which must be possible to do through a chat action bar
2021-10-22 16:24:12 +02:00
type ChatActionBar interface {
ChatActionBarType() string
}
// Describes a keyboard button type
type KeyboardButtonType interface {
KeyboardButtonTypeType() string
}
// Describes the type of an inline keyboard button
type InlineKeyboardButtonType interface {
InlineKeyboardButtonTypeType() string
}
// Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots
type ReplyMarkup interface {
ReplyMarkupType() string
}
// Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl
type LoginUrlInfo interface {
LoginUrlInfoType() string
}
// Describes a text object inside an instant-view web page
type RichText interface {
RichTextType() string
}
// Describes a horizontal alignment of a table cell content
type PageBlockHorizontalAlignment interface {
PageBlockHorizontalAlignmentType() string
}
// Describes a Vertical alignment of a table cell content
type PageBlockVerticalAlignment interface {
PageBlockVerticalAlignmentType() string
}
// Describes a block of an instant view web page
type PageBlock interface {
PageBlockType() string
}
// Contains information about the payment method chosen by the user
type InputCredentials interface {
InputCredentialsType() string
}
2023-06-04 22:58:07 +02:00
// Contains information about a payment provider
type PaymentProvider interface {
PaymentProviderType() string
}
// Describes an invoice to process
type InputInvoice interface {
InputInvoiceType() string
}
// Describes a media, which is attached to an invoice
type MessageExtendedMedia interface {
MessageExtendedMediaType() string
}
2021-10-22 16:24:12 +02:00
// Contains the type of a Telegram Passport element
type PassportElementType interface {
PassportElementTypeType() string
}
// Contains information about a Telegram Passport element
type PassportElement interface {
PassportElementType() string
}
// Contains information about a Telegram Passport element to be saved
type InputPassportElement interface {
InputPassportElementType() string
}
// Contains the description of an error in a Telegram Passport element
type PassportElementErrorSource interface {
PassportElementErrorSourceType() string
}
// Contains the description of an error in a Telegram Passport element; for bots only
type InputPassportElementErrorSource interface {
InputPassportElementErrorSourceType() string
}
// Contains the content of a message
type MessageContent interface {
MessageContentType() string
}
// Represents a part of the text which must be formatted differently
type TextEntityType interface {
TextEntityTypeType() string
}
// Contains information about the time when a scheduled message will be sent
type MessageSchedulingState interface {
MessageSchedulingStateType() string
}
// The content of a message to send
type InputMessageContent interface {
InputMessageContentType() string
}
// Represents a filter for message search results
type SearchMessagesFilter interface {
SearchMessagesFilterType() string
}
// Describes the different types of activity in a chat
type ChatAction interface {
ChatActionType() string
}
// Describes the last time the user was online
type UserStatus interface {
UserStatusType() string
}
// Describes the reason why a call was discarded
type CallDiscardReason interface {
CallDiscardReasonType() string
}
// Describes the type of a call server
type CallServerType interface {
CallServerTypeType() string
}
// Describes the current call state
type CallState interface {
CallStateType() string
}
2021-12-08 10:23:00 +01:00
// Describes the quality of a group call video
type GroupCallVideoQuality interface {
GroupCallVideoQualityType() string
}
2021-10-22 16:24:12 +02:00
// Describes the exact type of a problem with a call
type CallProblem interface {
CallProblemType() string
}
2021-12-08 10:23:00 +01:00
// Contains animated stickers which must be used for dice animation rendering
2021-10-22 16:24:12 +02:00
type DiceStickers interface {
DiceStickersType() string
}
2023-06-04 22:58:07 +02:00
// Describes result of speech recognition in a voice note
type SpeechRecognitionResult interface {
SpeechRecognitionResultType() string
}
2021-10-22 16:24:12 +02:00
// Represents a single result of an inline query; for bots only
type InputInlineQueryResult interface {
InputInlineQueryResultType() string
}
// Represents a single result of an inline query
type InlineQueryResult interface {
InlineQueryResultType() string
}
// Represents a payload of a callback query
type CallbackQueryPayload interface {
CallbackQueryPayloadType() string
}
// Represents a chat event
type ChatEventAction interface {
ChatEventActionType() string
}
// Represents the value of a string in a language pack
type LanguagePackStringValue interface {
LanguagePackStringValueType() string
}
2023-06-04 22:58:07 +02:00
// Describes type of a limit, increased for Premium users
type PremiumLimitType interface {
PremiumLimitTypeType() string
}
// Describes a feature available to Premium users
type PremiumFeature interface {
PremiumFeatureType() string
}
// Describes a source from which the Premium features screen is opened
type PremiumSource interface {
PremiumSourceType() string
}
// Describes a purpose of an in-store payment
type StorePaymentPurpose interface {
StorePaymentPurposeType() string
}
2021-10-22 16:24:12 +02:00
// Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org
type DeviceToken interface {
DeviceTokenType() string
}
// Describes a fill of a background
type BackgroundFill interface {
BackgroundFillType() string
}
// Describes the type of a background
type BackgroundType interface {
BackgroundTypeType() string
}
// Contains information about background to set
type InputBackground interface {
InputBackgroundType() string
}
// Represents result of checking whether the current session can be used to transfer a chat ownership to another user
type CanTransferOwnershipResult interface {
CanTransferOwnershipResultType() string
}
// Represents result of checking whether a username can be set for a chat
type CheckChatUsernameResult interface {
CheckChatUsernameResultType() string
}
2021-12-08 10:23:00 +01:00
// Represents result of checking whether a name can be used for a new sticker set
type CheckStickerSetNameResult interface {
CheckStickerSetNameResultType() string
}
// Represents result of 2-step verification password reset
type ResetPasswordResult interface {
ResetPasswordResultType() string
}
// Contains information about a file with messages exported from another app
type MessageFileType interface {
MessageFileTypeType() string
}
2021-10-22 16:24:12 +02:00
// Contains content of a push message notification
type PushMessageContent interface {
PushMessageContentType() string
}
// Contains detailed information about a notification
type NotificationType interface {
NotificationTypeType() string
}
// Describes the type of notifications in a notification group
type NotificationGroupType interface {
NotificationGroupTypeType() string
}
// Represents the value of an option
type OptionValue interface {
OptionValueType() string
}
// Represents a JSON value
type JsonValue interface {
JsonValueType() string
}
// Represents a single rule for managing privacy settings
type UserPrivacySettingRule interface {
UserPrivacySettingRuleType() string
}
// Describes available user privacy settings
type UserPrivacySetting interface {
UserPrivacySettingType() string
}
2023-06-04 22:58:07 +02:00
// Represents the type of a session
type SessionType interface {
SessionTypeType() string
}
2021-10-22 16:24:12 +02:00
// Describes the reason why a chat is reported
type ChatReportReason interface {
ChatReportReasonType() string
}
2023-06-04 22:58:07 +02:00
// Describes the target chat to be opened
type TargetChat interface {
TargetChatType() string
}
// Describes an internal https://t.me or tg: link, which must be processed by the application in a special way
2021-12-08 10:23:00 +01:00
type InternalLinkType interface {
InternalLinkTypeType() string
}
2021-10-22 16:24:12 +02:00
// Represents the type of a file
type FileType interface {
FileTypeType() string
}
// Represents the type of a network
type NetworkType interface {
NetworkTypeType() string
}
// Contains statistics about network usage
type NetworkStatisticsEntry interface {
NetworkStatisticsEntryType() string
}
// Describes the current state of the connection to Telegram servers
type ConnectionState interface {
ConnectionStateType() string
}
// Represents the categories of chats for which a list of frequently used chats can be retrieved
type TopChatCategory interface {
TopChatCategoryType() string
}
// Describes the type of a URL linking to an internal Telegram entity
type TMeUrlType interface {
TMeUrlTypeType() string
}
// Describes an action suggested to the current user
type SuggestedAction interface {
SuggestedActionType() string
}
2023-06-04 22:58:07 +02:00
// Describes the way the text needs to be parsed for text entities
2021-10-22 16:24:12 +02:00
type TextParseMode interface {
TextParseModeType() string
}
// Describes the type of a proxy server
type ProxyType interface {
ProxyTypeType() string
}
// Describes a statistical graph
type StatisticalGraph interface {
StatisticalGraphType() string
}
// Contains a detailed statistics about a chat
type ChatStatistics interface {
ChatStatisticsType() string
}
2021-12-08 10:23:00 +01:00
// Represents a vector path command
type VectorPathCommand interface {
VectorPathCommandType() string
}
// Represents the scope to which bot commands are relevant
type BotCommandScope interface {
BotCommandScopeType() string
}
2021-10-22 16:24:12 +02:00
// Contains notifications about data changes
type Update interface {
UpdateType() string
}
// Describes a stream to which TDLib internal log is written
type LogStream interface {
LogStreamType() string
}
// An object of this type can be returned on every function call, in case of an error
type Error struct {
meta
// Error code; subject to future changes. If the error code is 406, the error message must not be processed in any way and must not be displayed to the user
Code int32 `json:"code"`
// Error message; subject to future changes
Message string `json:"message"`
}
func (entity *Error) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Error
return json.Marshal((*stub)(entity))
}
func (*Error) GetClass() string {
return ClassError
}
func (*Error) GetType() string {
return TypeError
}
// An object of this type is returned on a successful function call for certain functions
type Ok struct {
meta
}
func (entity *Ok) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Ok
return json.Marshal((*stub)(entity))
}
func (*Ok) GetClass() string {
return ClassOk
}
func (*Ok) GetType() string {
return TypeOk
}
// An authentication code is delivered via a private Telegram message, which can be viewed from another active session
type AuthenticationCodeTypeTelegramMessage struct {
meta
// Length of the code
Length int32 `json:"length"`
}
func (entity *AuthenticationCodeTypeTelegramMessage) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthenticationCodeTypeTelegramMessage
return json.Marshal((*stub)(entity))
}
func (*AuthenticationCodeTypeTelegramMessage) GetClass() string {
return ClassAuthenticationCodeType
}
func (*AuthenticationCodeTypeTelegramMessage) GetType() string {
return TypeAuthenticationCodeTypeTelegramMessage
}
func (*AuthenticationCodeTypeTelegramMessage) AuthenticationCodeTypeType() string {
return TypeAuthenticationCodeTypeTelegramMessage
}
// An authentication code is delivered via an SMS message to the specified phone number
type AuthenticationCodeTypeSms struct {
meta
// Length of the code
Length int32 `json:"length"`
}
func (entity *AuthenticationCodeTypeSms) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthenticationCodeTypeSms
return json.Marshal((*stub)(entity))
}
func (*AuthenticationCodeTypeSms) GetClass() string {
return ClassAuthenticationCodeType
}
func (*AuthenticationCodeTypeSms) GetType() string {
return TypeAuthenticationCodeTypeSms
}
func (*AuthenticationCodeTypeSms) AuthenticationCodeTypeType() string {
return TypeAuthenticationCodeTypeSms
}
// An authentication code is delivered via a phone call to the specified phone number
type AuthenticationCodeTypeCall struct {
meta
// Length of the code
Length int32 `json:"length"`
}
func (entity *AuthenticationCodeTypeCall) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthenticationCodeTypeCall
return json.Marshal((*stub)(entity))
}
func (*AuthenticationCodeTypeCall) GetClass() string {
return ClassAuthenticationCodeType
}
func (*AuthenticationCodeTypeCall) GetType() string {
return TypeAuthenticationCodeTypeCall
}
func (*AuthenticationCodeTypeCall) AuthenticationCodeTypeType() string {
return TypeAuthenticationCodeTypeCall
}
2022-04-18 22:45:01 +02:00
// An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically
2021-10-22 16:24:12 +02:00
type AuthenticationCodeTypeFlashCall struct {
meta
// Pattern of the phone number from which the call will be made
Pattern string `json:"pattern"`
}
func (entity *AuthenticationCodeTypeFlashCall) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthenticationCodeTypeFlashCall
return json.Marshal((*stub)(entity))
}
func (*AuthenticationCodeTypeFlashCall) GetClass() string {
return ClassAuthenticationCodeType
}
func (*AuthenticationCodeTypeFlashCall) GetType() string {
return TypeAuthenticationCodeTypeFlashCall
}
func (*AuthenticationCodeTypeFlashCall) AuthenticationCodeTypeType() string {
return TypeAuthenticationCodeTypeFlashCall
}
2022-04-18 22:45:01 +02:00
// An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user
2021-12-08 10:23:00 +01:00
type AuthenticationCodeTypeMissedCall struct {
meta
// Prefix of the phone number from which the call will be made
PhoneNumberPrefix string `json:"phone_number_prefix"`
// Number of digits in the code, excluding the prefix
Length int32 `json:"length"`
}
func (entity *AuthenticationCodeTypeMissedCall) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthenticationCodeTypeMissedCall
return json.Marshal((*stub)(entity))
}
func (*AuthenticationCodeTypeMissedCall) GetClass() string {
return ClassAuthenticationCodeType
}
func (*AuthenticationCodeTypeMissedCall) GetType() string {
return TypeAuthenticationCodeTypeMissedCall
}
func (*AuthenticationCodeTypeMissedCall) AuthenticationCodeTypeType() string {
return TypeAuthenticationCodeTypeMissedCall
}
2023-06-04 22:58:07 +02:00
// An authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number's NFT
type AuthenticationCodeTypeFragment struct {
meta
// URL to open to receive the code
Url string `json:"url"`
// Length of the code
Length int32 `json:"length"`
}
func (entity *AuthenticationCodeTypeFragment) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthenticationCodeTypeFragment
return json.Marshal((*stub)(entity))
}
func (*AuthenticationCodeTypeFragment) GetClass() string {
return ClassAuthenticationCodeType
}
func (*AuthenticationCodeTypeFragment) GetType() string {
return TypeAuthenticationCodeTypeFragment
}
func (*AuthenticationCodeTypeFragment) AuthenticationCodeTypeType() string {
return TypeAuthenticationCodeTypeFragment
}
2021-10-22 16:24:12 +02:00
// Information about the authentication code that was sent
type AuthenticationCodeInfo struct {
meta
// A phone number that is being authenticated
PhoneNumber string `json:"phone_number"`
2021-12-08 10:23:00 +01:00
// The way the code was sent to the user
2021-10-22 16:24:12 +02:00
Type AuthenticationCodeType `json:"type"`
2021-12-08 10:23:00 +01:00
// The way the next code will be sent to the user; may be null
2021-10-22 16:24:12 +02:00
NextType AuthenticationCodeType `json:"next_type"`
2021-12-08 10:23:00 +01:00
// Timeout before the code can be re-sent, in seconds
2021-10-22 16:24:12 +02:00
Timeout int32 `json:"timeout"`
}
func (entity *AuthenticationCodeInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthenticationCodeInfo
return json.Marshal((*stub)(entity))
}
func (*AuthenticationCodeInfo) GetClass() string {
return ClassAuthenticationCodeInfo
}
func (*AuthenticationCodeInfo) GetType() string {
return TypeAuthenticationCodeInfo
}
func (authenticationCodeInfo *AuthenticationCodeInfo) UnmarshalJSON(data []byte) error {
var tmp struct {
PhoneNumber string `json:"phone_number"`
Type json.RawMessage `json:"type"`
NextType json.RawMessage `json:"next_type"`
Timeout int32 `json:"timeout"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
authenticationCodeInfo.PhoneNumber = tmp.PhoneNumber
authenticationCodeInfo.Timeout = tmp.Timeout
fieldType, _ := UnmarshalAuthenticationCodeType(tmp.Type)
authenticationCodeInfo.Type = fieldType
fieldNextType, _ := UnmarshalAuthenticationCodeType(tmp.NextType)
authenticationCodeInfo.NextType = fieldNextType
return nil
}
// Information about the email address authentication code that was sent
type EmailAddressAuthenticationCodeInfo struct {
meta
// Pattern of the email address to which an authentication code was sent
EmailAddressPattern string `json:"email_address_pattern"`
// Length of the code; 0 if unknown
Length int32 `json:"length"`
}
func (entity *EmailAddressAuthenticationCodeInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub EmailAddressAuthenticationCodeInfo
return json.Marshal((*stub)(entity))
}
func (*EmailAddressAuthenticationCodeInfo) GetClass() string {
return ClassEmailAddressAuthenticationCodeInfo
}
func (*EmailAddressAuthenticationCodeInfo) GetType() string {
return TypeEmailAddressAuthenticationCodeInfo
}
2023-06-04 22:58:07 +02:00
// An authentication code delivered to a user's email address
type EmailAddressAuthenticationCode struct {
meta
// The code
Code string `json:"code"`
}
func (entity *EmailAddressAuthenticationCode) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub EmailAddressAuthenticationCode
return json.Marshal((*stub)(entity))
}
func (*EmailAddressAuthenticationCode) GetClass() string {
return ClassEmailAddressAuthentication
}
func (*EmailAddressAuthenticationCode) GetType() string {
return TypeEmailAddressAuthenticationCode
}
func (*EmailAddressAuthenticationCode) EmailAddressAuthenticationType() string {
return TypeEmailAddressAuthenticationCode
}
// An authentication token received through Apple ID
type EmailAddressAuthenticationAppleId struct {
meta
// The token
Token string `json:"token"`
}
func (entity *EmailAddressAuthenticationAppleId) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub EmailAddressAuthenticationAppleId
return json.Marshal((*stub)(entity))
}
func (*EmailAddressAuthenticationAppleId) GetClass() string {
return ClassEmailAddressAuthentication
}
func (*EmailAddressAuthenticationAppleId) GetType() string {
return TypeEmailAddressAuthenticationAppleId
}
func (*EmailAddressAuthenticationAppleId) EmailAddressAuthenticationType() string {
return TypeEmailAddressAuthenticationAppleId
}
// An authentication token received through Google ID
type EmailAddressAuthenticationGoogleId struct {
meta
// The token
Token string `json:"token"`
}
func (entity *EmailAddressAuthenticationGoogleId) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub EmailAddressAuthenticationGoogleId
return json.Marshal((*stub)(entity))
}
func (*EmailAddressAuthenticationGoogleId) GetClass() string {
return ClassEmailAddressAuthentication
}
func (*EmailAddressAuthenticationGoogleId) GetType() string {
return TypeEmailAddressAuthenticationGoogleId
}
func (*EmailAddressAuthenticationGoogleId) EmailAddressAuthenticationType() string {
return TypeEmailAddressAuthenticationGoogleId
}
2021-10-22 16:24:12 +02:00
// Represents a part of the text that needs to be formatted in some unusual way
type TextEntity struct {
meta
// Offset of the entity, in UTF-16 code units
Offset int32 `json:"offset"`
// Length of the entity, in UTF-16 code units
Length int32 `json:"length"`
// Type of the entity
Type TextEntityType `json:"type"`
}
func (entity *TextEntity) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TextEntity
return json.Marshal((*stub)(entity))
}
func (*TextEntity) GetClass() string {
return ClassTextEntity
}
func (*TextEntity) GetType() string {
return TypeTextEntity
}
func (textEntity *TextEntity) UnmarshalJSON(data []byte) error {
var tmp struct {
Offset int32 `json:"offset"`
Length int32 `json:"length"`
Type json.RawMessage `json:"type"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
textEntity.Offset = tmp.Offset
textEntity.Length = tmp.Length
fieldType, _ := UnmarshalTextEntityType(tmp.Type)
textEntity.Type = fieldType
return nil
}
// Contains a list of text entities
type TextEntities struct {
meta
// List of text entities
Entities []*TextEntity `json:"entities"`
}
func (entity *TextEntities) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TextEntities
return json.Marshal((*stub)(entity))
}
func (*TextEntities) GetClass() string {
return ClassTextEntities
}
func (*TextEntities) GetType() string {
return TypeTextEntities
}
// A text with some entities
type FormattedText struct {
meta
// The text
Text string `json:"text"`
2023-06-04 22:58:07 +02:00
// Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other
2021-10-22 16:24:12 +02:00
Entities []*TextEntity `json:"entities"`
}
func (entity *FormattedText) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FormattedText
return json.Marshal((*stub)(entity))
}
func (*FormattedText) GetClass() string {
return ClassFormattedText
}
func (*FormattedText) GetType() string {
return TypeFormattedText
}
// Contains Telegram terms of service
type TermsOfService struct {
meta
// Text of the terms of service
Text *FormattedText `json:"text"`
2023-06-04 22:58:07 +02:00
// The minimum age of a user to be able to accept the terms; 0 if age isn't restricted
2021-10-22 16:24:12 +02:00
MinUserAge int32 `json:"min_user_age"`
// True, if a blocking popup with terms of service must be shown to the user
ShowPopup bool `json:"show_popup"`
}
func (entity *TermsOfService) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TermsOfService
return json.Marshal((*stub)(entity))
}
func (*TermsOfService) GetClass() string {
return ClassTermsOfService
}
func (*TermsOfService) GetType() string {
return TypeTermsOfService
}
2023-06-04 22:58:07 +02:00
// Initializetion parameters are needed. Call setTdlibParameters to provide them
2021-10-22 16:24:12 +02:00
type AuthorizationStateWaitTdlibParameters struct {
meta
}
func (entity *AuthorizationStateWaitTdlibParameters) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthorizationStateWaitTdlibParameters
return json.Marshal((*stub)(entity))
}
func (*AuthorizationStateWaitTdlibParameters) GetClass() string {
return ClassAuthorizationState
}
func (*AuthorizationStateWaitTdlibParameters) GetType() string {
return TypeAuthorizationStateWaitTdlibParameters
}
func (*AuthorizationStateWaitTdlibParameters) AuthorizationStateType() string {
return TypeAuthorizationStateWaitTdlibParameters
}
2023-06-04 22:58:07 +02:00
// TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options
type AuthorizationStateWaitPhoneNumber struct {
meta
}
func (entity *AuthorizationStateWaitPhoneNumber) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthorizationStateWaitPhoneNumber
return json.Marshal((*stub)(entity))
}
func (*AuthorizationStateWaitPhoneNumber) GetClass() string {
return ClassAuthorizationState
}
func (*AuthorizationStateWaitPhoneNumber) GetType() string {
return TypeAuthorizationStateWaitPhoneNumber
}
func (*AuthorizationStateWaitPhoneNumber) AuthorizationStateType() string {
return TypeAuthorizationStateWaitPhoneNumber
}
// TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed
type AuthorizationStateWaitEmailAddress struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// True, if authorization through Apple ID is allowed
AllowAppleId bool `json:"allow_apple_id"`
// True, if authorization through Google ID is allowed
AllowGoogleId bool `json:"allow_google_id"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *AuthorizationStateWaitEmailAddress) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub AuthorizationStateWaitEmailAddress
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*AuthorizationStateWaitEmailAddress) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassAuthorizationState
}
2023-06-04 22:58:07 +02:00
func (*AuthorizationStateWaitEmailAddress) GetType() string {
return TypeAuthorizationStateWaitEmailAddress
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*AuthorizationStateWaitEmailAddress) AuthorizationStateType() string {
return TypeAuthorizationStateWaitEmailAddress
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code
type AuthorizationStateWaitEmailCode struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// True, if authorization through Apple ID is allowed
AllowAppleId bool `json:"allow_apple_id"`
// True, if authorization through Google ID is allowed
AllowGoogleId bool `json:"allow_google_id"`
// Information about the sent authentication code
CodeInfo *EmailAddressAuthenticationCodeInfo `json:"code_info"`
// Point in time (Unix timestamp) when the user will be able to authorize with a code sent to the user's phone number; 0 if unknown
NextPhoneNumberAuthorizationDate int32 `json:"next_phone_number_authorization_date"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *AuthorizationStateWaitEmailCode) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub AuthorizationStateWaitEmailCode
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*AuthorizationStateWaitEmailCode) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassAuthorizationState
}
2023-06-04 22:58:07 +02:00
func (*AuthorizationStateWaitEmailCode) GetType() string {
return TypeAuthorizationStateWaitEmailCode
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*AuthorizationStateWaitEmailCode) AuthorizationStateType() string {
return TypeAuthorizationStateWaitEmailCode
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code
2021-10-22 16:24:12 +02:00
type AuthorizationStateWaitCode struct {
meta
// Information about the authorization code that was sent
CodeInfo *AuthenticationCodeInfo `json:"code_info"`
}
func (entity *AuthorizationStateWaitCode) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthorizationStateWaitCode
return json.Marshal((*stub)(entity))
}
func (*AuthorizationStateWaitCode) GetClass() string {
return ClassAuthorizationState
}
func (*AuthorizationStateWaitCode) GetType() string {
return TypeAuthorizationStateWaitCode
}
func (*AuthorizationStateWaitCode) AuthorizationStateType() string {
return TypeAuthorizationStateWaitCode
}
// The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link
type AuthorizationStateWaitOtherDeviceConfirmation struct {
meta
// A tg:// URL for the QR code. The link will be updated frequently
Link string `json:"link"`
}
func (entity *AuthorizationStateWaitOtherDeviceConfirmation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthorizationStateWaitOtherDeviceConfirmation
return json.Marshal((*stub)(entity))
}
func (*AuthorizationStateWaitOtherDeviceConfirmation) GetClass() string {
return ClassAuthorizationState
}
func (*AuthorizationStateWaitOtherDeviceConfirmation) GetType() string {
return TypeAuthorizationStateWaitOtherDeviceConfirmation
}
func (*AuthorizationStateWaitOtherDeviceConfirmation) AuthorizationStateType() string {
return TypeAuthorizationStateWaitOtherDeviceConfirmation
}
2023-06-04 22:58:07 +02:00
// The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data
2021-10-22 16:24:12 +02:00
type AuthorizationStateWaitRegistration struct {
meta
// Telegram terms of service
TermsOfService *TermsOfService `json:"terms_of_service"`
}
func (entity *AuthorizationStateWaitRegistration) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthorizationStateWaitRegistration
return json.Marshal((*stub)(entity))
}
func (*AuthorizationStateWaitRegistration) GetClass() string {
return ClassAuthorizationState
}
func (*AuthorizationStateWaitRegistration) GetType() string {
return TypeAuthorizationStateWaitRegistration
}
func (*AuthorizationStateWaitRegistration) AuthorizationStateType() string {
return TypeAuthorizationStateWaitRegistration
}
2023-06-04 22:58:07 +02:00
// The user has been authorized, but needs to enter a 2-step verification password to start using the application. Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week
2021-10-22 16:24:12 +02:00
type AuthorizationStateWaitPassword struct {
meta
// Hint for the password; may be empty
PasswordHint string `json:"password_hint"`
// True, if a recovery email address has been set up
HasRecoveryEmailAddress bool `json:"has_recovery_email_address"`
// Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent
RecoveryEmailAddressPattern string `json:"recovery_email_address_pattern"`
}
func (entity *AuthorizationStateWaitPassword) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthorizationStateWaitPassword
return json.Marshal((*stub)(entity))
}
func (*AuthorizationStateWaitPassword) GetClass() string {
return ClassAuthorizationState
}
func (*AuthorizationStateWaitPassword) GetType() string {
return TypeAuthorizationStateWaitPassword
}
func (*AuthorizationStateWaitPassword) AuthorizationStateType() string {
return TypeAuthorizationStateWaitPassword
}
2023-06-04 22:58:07 +02:00
// The user has been successfully authorized. TDLib is now ready to answer general requests
2021-10-22 16:24:12 +02:00
type AuthorizationStateReady struct {
meta
}
func (entity *AuthorizationStateReady) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthorizationStateReady
return json.Marshal((*stub)(entity))
}
func (*AuthorizationStateReady) GetClass() string {
return ClassAuthorizationState
}
func (*AuthorizationStateReady) GetType() string {
return TypeAuthorizationStateReady
}
func (*AuthorizationStateReady) AuthorizationStateType() string {
return TypeAuthorizationStateReady
}
// The user is currently logging out
type AuthorizationStateLoggingOut struct {
meta
}
func (entity *AuthorizationStateLoggingOut) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthorizationStateLoggingOut
return json.Marshal((*stub)(entity))
}
func (*AuthorizationStateLoggingOut) GetClass() string {
return ClassAuthorizationState
}
func (*AuthorizationStateLoggingOut) GetType() string {
return TypeAuthorizationStateLoggingOut
}
func (*AuthorizationStateLoggingOut) AuthorizationStateType() string {
return TypeAuthorizationStateLoggingOut
}
// TDLib is closing, all subsequent queries will be answered with the error 500. Note that closing TDLib can take a while. All resources will be freed only after authorizationStateClosed has been received
type AuthorizationStateClosing struct {
meta
}
func (entity *AuthorizationStateClosing) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthorizationStateClosing
return json.Marshal((*stub)(entity))
}
func (*AuthorizationStateClosing) GetClass() string {
return ClassAuthorizationState
}
func (*AuthorizationStateClosing) GetType() string {
return TypeAuthorizationStateClosing
}
func (*AuthorizationStateClosing) AuthorizationStateType() string {
return TypeAuthorizationStateClosing
}
2021-12-08 10:23:00 +01:00
// TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to with error code 500. To continue working, one must create a new instance of the TDLib client
2021-10-22 16:24:12 +02:00
type AuthorizationStateClosed struct {
meta
}
func (entity *AuthorizationStateClosed) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AuthorizationStateClosed
return json.Marshal((*stub)(entity))
}
func (*AuthorizationStateClosed) GetClass() string {
return ClassAuthorizationState
}
func (*AuthorizationStateClosed) GetType() string {
return TypeAuthorizationStateClosed
}
func (*AuthorizationStateClosed) AuthorizationStateType() string {
return TypeAuthorizationStateClosed
}
// Represents the current state of 2-step verification
type PasswordState struct {
meta
// True, if a 2-step verification password is set
HasPassword bool `json:"has_password"`
// Hint for the password; may be empty
PasswordHint string `json:"password_hint"`
// True, if a recovery email is set
HasRecoveryEmailAddress bool `json:"has_recovery_email_address"`
// True, if some Telegram Passport elements were saved
HasPassportData bool `json:"has_passport_data"`
// Information about the recovery email address to which the confirmation email was sent; may be null
RecoveryEmailAddressCodeInfo *EmailAddressAuthenticationCodeInfo `json:"recovery_email_address_code_info"`
2023-06-04 22:58:07 +02:00
// Pattern of the email address set up for logging in
LoginEmailAddressPattern string `json:"login_email_address_pattern"`
// If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword
2021-12-08 10:23:00 +01:00
PendingResetDate int32 `json:"pending_reset_date"`
2021-10-22 16:24:12 +02:00
}
func (entity *PasswordState) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PasswordState
return json.Marshal((*stub)(entity))
}
func (*PasswordState) GetClass() string {
return ClassPasswordState
}
func (*PasswordState) GetType() string {
return TypePasswordState
}
// Contains information about the current recovery email address
type RecoveryEmailAddress struct {
meta
// Recovery email address
RecoveryEmailAddress string `json:"recovery_email_address"`
}
func (entity *RecoveryEmailAddress) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub RecoveryEmailAddress
return json.Marshal((*stub)(entity))
}
func (*RecoveryEmailAddress) GetClass() string {
return ClassRecoveryEmailAddress
}
func (*RecoveryEmailAddress) GetType() string {
return TypeRecoveryEmailAddress
}
// Returns information about the availability of a temporary password, which can be used for payments
type TemporaryPasswordState struct {
meta
// True, if a temporary password is available
HasPassword bool `json:"has_password"`
// Time left before the temporary password expires, in seconds
ValidFor int32 `json:"valid_for"`
}
func (entity *TemporaryPasswordState) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TemporaryPasswordState
return json.Marshal((*stub)(entity))
}
func (*TemporaryPasswordState) GetClass() string {
return ClassTemporaryPasswordState
}
func (*TemporaryPasswordState) GetType() string {
return TypeTemporaryPasswordState
}
// Represents a local file
type LocalFile struct {
meta
// Local path to the locally available file part; may be empty
Path string `json:"path"`
2022-04-18 22:45:01 +02:00
// True, if it is possible to download or generate the file
2021-10-22 16:24:12 +02:00
CanBeDownloaded bool `json:"can_be_downloaded"`
// True, if the file can be deleted
CanBeDeleted bool `json:"can_be_deleted"`
// True, if the file is currently being downloaded (or a local copy is being generated by some other means)
IsDownloadingActive bool `json:"is_downloading_active"`
// True, if the local copy is fully available
IsDownloadingCompleted bool `json:"is_downloading_completed"`
// Download will be started from this offset. downloaded_prefix_size is calculated from this offset
2023-06-04 22:58:07 +02:00
DownloadOffset int64 `json:"download_offset"`
2021-12-08 10:23:00 +01:00
// If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes
2023-06-04 22:58:07 +02:00
DownloadedPrefixSize int64 `json:"downloaded_prefix_size"`
2021-12-08 10:23:00 +01:00
// Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage
2023-06-04 22:58:07 +02:00
DownloadedSize int64 `json:"downloaded_size"`
2021-10-22 16:24:12 +02:00
}
func (entity *LocalFile) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub LocalFile
return json.Marshal((*stub)(entity))
}
func (*LocalFile) GetClass() string {
return ClassLocalFile
}
func (*LocalFile) GetType() string {
return TypeLocalFile
}
// Represents a remote file
type RemoteFile struct {
meta
2023-06-04 22:58:07 +02:00
// Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location
2021-10-22 16:24:12 +02:00
Id string `json:"id"`
// Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time
UniqueId string `json:"unique_id"`
// True, if the file is currently being uploaded (or a remote copy is being generated by some other means)
IsUploadingActive bool `json:"is_uploading_active"`
// True, if a remote copy is fully available
IsUploadingCompleted bool `json:"is_uploading_completed"`
2021-12-08 10:23:00 +01:00
// Size of the remote available part of the file, in bytes; 0 if unknown
2023-06-04 22:58:07 +02:00
UploadedSize int64 `json:"uploaded_size"`
2021-10-22 16:24:12 +02:00
}
func (entity *RemoteFile) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub RemoteFile
return json.Marshal((*stub)(entity))
}
func (*RemoteFile) GetClass() string {
return ClassRemoteFile
}
func (*RemoteFile) GetType() string {
return TypeRemoteFile
}
// Represents a file
type File struct {
meta
// Unique file identifier
Id int32 `json:"id"`
2021-12-08 10:23:00 +01:00
// File size, in bytes; 0 if unknown
2023-06-04 22:58:07 +02:00
Size int64 `json:"size"`
2021-12-08 10:23:00 +01:00
// Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress
2023-06-04 22:58:07 +02:00
ExpectedSize int64 `json:"expected_size"`
2021-10-22 16:24:12 +02:00
// Information about the local copy of the file
Local *LocalFile `json:"local"`
// Information about the remote copy of the file
Remote *RemoteFile `json:"remote"`
}
func (entity *File) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub File
return json.Marshal((*stub)(entity))
}
func (*File) GetClass() string {
return ClassFile
}
func (*File) GetType() string {
return TypeFile
}
// A file defined by its unique ID
type InputFileId struct {
meta
// Unique file identifier
Id int32 `json:"id"`
}
func (entity *InputFileId) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputFileId
return json.Marshal((*stub)(entity))
}
func (*InputFileId) GetClass() string {
return ClassInputFile
}
func (*InputFileId) GetType() string {
return TypeInputFileId
}
func (*InputFileId) InputFileType() string {
return TypeInputFileId
}
// A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application
type InputFileRemote struct {
meta
// Remote file identifier
Id string `json:"id"`
}
func (entity *InputFileRemote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputFileRemote
return json.Marshal((*stub)(entity))
}
func (*InputFileRemote) GetClass() string {
return ClassInputFile
}
func (*InputFileRemote) GetType() string {
return TypeInputFileRemote
}
func (*InputFileRemote) InputFileType() string {
return TypeInputFileRemote
}
// A file defined by a local path
type InputFileLocal struct {
meta
// Local path to the file
Path string `json:"path"`
}
func (entity *InputFileLocal) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputFileLocal
return json.Marshal((*stub)(entity))
}
func (*InputFileLocal) GetClass() string {
return ClassInputFile
}
func (*InputFileLocal) GetType() string {
return TypeInputFileLocal
}
func (*InputFileLocal) InputFileType() string {
return TypeInputFileLocal
}
// A file generated by the application
type InputFileGenerated struct {
meta
// Local path to a file from which the file is generated; may be empty if there is no such file
OriginalPath string `json:"original_path"`
2021-12-08 10:23:00 +01:00
// String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage
2021-10-22 16:24:12 +02:00
Conversion string `json:"conversion"`
2021-12-08 10:23:00 +01:00
// Expected size of the generated file, in bytes; 0 if unknown
2023-06-04 22:58:07 +02:00
ExpectedSize int64 `json:"expected_size"`
2021-10-22 16:24:12 +02:00
}
func (entity *InputFileGenerated) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputFileGenerated
return json.Marshal((*stub)(entity))
}
func (*InputFileGenerated) GetClass() string {
return ClassInputFile
}
func (*InputFileGenerated) GetType() string {
return TypeInputFileGenerated
}
func (*InputFileGenerated) InputFileType() string {
return TypeInputFileGenerated
}
// Describes an image in JPEG format
type PhotoSize struct {
meta
// Image type (see https://core.telegram.org/constructor/photoSize)
Type string `json:"type"`
// Information about the image file
Photo *File `json:"photo"`
// Image width
Width int32 `json:"width"`
// Image height
Height int32 `json:"height"`
2021-12-08 10:23:00 +01:00
// Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes
2021-10-22 16:24:12 +02:00
ProgressiveSizes []int32 `json:"progressive_sizes"`
}
func (entity *PhotoSize) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PhotoSize
return json.Marshal((*stub)(entity))
}
func (*PhotoSize) GetClass() string {
return ClassPhotoSize
}
func (*PhotoSize) GetType() string {
return TypePhotoSize
}
// Thumbnail image of a very poor quality and low resolution
type Minithumbnail struct {
meta
// Thumbnail width, usually doesn't exceed 40
Width int32 `json:"width"`
// Thumbnail height, usually doesn't exceed 40
Height int32 `json:"height"`
// The thumbnail in JPEG format
Data []byte `json:"data"`
}
func (entity *Minithumbnail) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Minithumbnail
return json.Marshal((*stub)(entity))
}
func (*Minithumbnail) GetClass() string {
return ClassMinithumbnail
}
func (*Minithumbnail) GetType() string {
return TypeMinithumbnail
}
// The thumbnail is in JPEG format
type ThumbnailFormatJpeg struct {
meta
}
func (entity *ThumbnailFormatJpeg) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ThumbnailFormatJpeg
return json.Marshal((*stub)(entity))
}
func (*ThumbnailFormatJpeg) GetClass() string {
return ClassThumbnailFormat
}
func (*ThumbnailFormatJpeg) GetType() string {
return TypeThumbnailFormatJpeg
}
func (*ThumbnailFormatJpeg) ThumbnailFormatType() string {
return TypeThumbnailFormatJpeg
}
2023-06-04 22:58:07 +02:00
// The thumbnail is in static GIF format. It will be used only for some bot inline results
type ThumbnailFormatGif struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *ThumbnailFormatGif) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ThumbnailFormatGif
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatGif) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassThumbnailFormat
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatGif) GetType() string {
return TypeThumbnailFormatGif
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatGif) ThumbnailFormatType() string {
return TypeThumbnailFormatGif
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The thumbnail is in MPEG4 format. It will be used only for some animations and videos
type ThumbnailFormatMpeg4 struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *ThumbnailFormatMpeg4) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ThumbnailFormatMpeg4
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatMpeg4) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassThumbnailFormat
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatMpeg4) GetType() string {
return TypeThumbnailFormatMpeg4
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatMpeg4) ThumbnailFormatType() string {
return TypeThumbnailFormatMpeg4
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The thumbnail is in PNG format. It will be used only for background patterns
type ThumbnailFormatPng struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *ThumbnailFormatPng) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ThumbnailFormatPng
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatPng) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassThumbnailFormat
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatPng) GetType() string {
return TypeThumbnailFormatPng
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatPng) ThumbnailFormatType() string {
return TypeThumbnailFormatPng
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The thumbnail is in TGS format. It will be used only for TGS sticker sets
2021-10-22 16:24:12 +02:00
type ThumbnailFormatTgs struct {
meta
}
func (entity *ThumbnailFormatTgs) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ThumbnailFormatTgs
return json.Marshal((*stub)(entity))
}
func (*ThumbnailFormatTgs) GetClass() string {
return ClassThumbnailFormat
}
func (*ThumbnailFormatTgs) GetType() string {
return TypeThumbnailFormatTgs
}
func (*ThumbnailFormatTgs) ThumbnailFormatType() string {
return TypeThumbnailFormatTgs
}
2023-06-04 22:58:07 +02:00
// The thumbnail is in WEBM format. It will be used only for WEBM sticker sets
type ThumbnailFormatWebm struct {
2022-04-18 22:45:01 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *ThumbnailFormatWebm) MarshalJSON() ([]byte, error) {
2022-04-18 22:45:01 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ThumbnailFormatWebm
2022-04-18 22:45:01 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatWebm) GetClass() string {
2022-04-18 22:45:01 +02:00
return ClassThumbnailFormat
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatWebm) GetType() string {
return TypeThumbnailFormatWebm
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ThumbnailFormatWebm) ThumbnailFormatType() string {
return TypeThumbnailFormatWebm
}
// The thumbnail is in WEBP format. It will be used only for some stickers
type ThumbnailFormatWebp struct {
meta
}
func (entity *ThumbnailFormatWebp) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ThumbnailFormatWebp
return json.Marshal((*stub)(entity))
}
func (*ThumbnailFormatWebp) GetClass() string {
return ClassThumbnailFormat
}
func (*ThumbnailFormatWebp) GetType() string {
return TypeThumbnailFormatWebp
}
func (*ThumbnailFormatWebp) ThumbnailFormatType() string {
return TypeThumbnailFormatWebp
2021-10-22 16:24:12 +02:00
}
// Represents a thumbnail
type Thumbnail struct {
meta
// Thumbnail format
Format ThumbnailFormat `json:"format"`
// Thumbnail width
Width int32 `json:"width"`
// Thumbnail height
Height int32 `json:"height"`
// The thumbnail
File *File `json:"file"`
}
func (entity *Thumbnail) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Thumbnail
return json.Marshal((*stub)(entity))
}
func (*Thumbnail) GetClass() string {
return ClassThumbnail
}
func (*Thumbnail) GetType() string {
return TypeThumbnail
}
func (thumbnail *Thumbnail) UnmarshalJSON(data []byte) error {
var tmp struct {
Format json.RawMessage `json:"format"`
Width int32 `json:"width"`
Height int32 `json:"height"`
File *File `json:"file"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
thumbnail.Width = tmp.Width
thumbnail.Height = tmp.Height
thumbnail.File = tmp.File
fieldFormat, _ := UnmarshalThumbnailFormat(tmp.Format)
thumbnail.Format = fieldFormat
return nil
}
2021-12-08 10:23:00 +01:00
// The mask is placed relatively to the forehead
2021-10-22 16:24:12 +02:00
type MaskPointForehead struct {
meta
}
func (entity *MaskPointForehead) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MaskPointForehead
return json.Marshal((*stub)(entity))
}
func (*MaskPointForehead) GetClass() string {
return ClassMaskPoint
}
func (*MaskPointForehead) GetType() string {
return TypeMaskPointForehead
}
func (*MaskPointForehead) MaskPointType() string {
return TypeMaskPointForehead
}
2021-12-08 10:23:00 +01:00
// The mask is placed relatively to the eyes
2021-10-22 16:24:12 +02:00
type MaskPointEyes struct {
meta
}
func (entity *MaskPointEyes) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MaskPointEyes
return json.Marshal((*stub)(entity))
}
func (*MaskPointEyes) GetClass() string {
return ClassMaskPoint
}
func (*MaskPointEyes) GetType() string {
return TypeMaskPointEyes
}
func (*MaskPointEyes) MaskPointType() string {
return TypeMaskPointEyes
}
2021-12-08 10:23:00 +01:00
// The mask is placed relatively to the mouth
2021-10-22 16:24:12 +02:00
type MaskPointMouth struct {
meta
}
func (entity *MaskPointMouth) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MaskPointMouth
return json.Marshal((*stub)(entity))
}
func (*MaskPointMouth) GetClass() string {
return ClassMaskPoint
}
func (*MaskPointMouth) GetType() string {
return TypeMaskPointMouth
}
func (*MaskPointMouth) MaskPointType() string {
return TypeMaskPointMouth
}
2021-12-08 10:23:00 +01:00
// The mask is placed relatively to the chin
2021-10-22 16:24:12 +02:00
type MaskPointChin struct {
meta
}
func (entity *MaskPointChin) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MaskPointChin
return json.Marshal((*stub)(entity))
}
func (*MaskPointChin) GetClass() string {
return ClassMaskPoint
}
func (*MaskPointChin) GetType() string {
return TypeMaskPointChin
}
func (*MaskPointChin) MaskPointType() string {
return TypeMaskPointChin
}
2021-12-08 10:23:00 +01:00
// Position on a photo where a mask is placed
2021-10-22 16:24:12 +02:00
type MaskPosition struct {
meta
2021-12-08 10:23:00 +01:00
// Part of the face, relative to which the mask is placed
2021-10-22 16:24:12 +02:00
Point MaskPoint `json:"point"`
// Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the mask just to the left of the default mask position)
XShift float64 `json:"x_shift"`
// Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. (For example, 1.0 will place the mask just below the default mask position)
YShift float64 `json:"y_shift"`
// Mask scaling coefficient. (For example, 2.0 means a doubled size)
Scale float64 `json:"scale"`
}
func (entity *MaskPosition) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MaskPosition
return json.Marshal((*stub)(entity))
}
func (*MaskPosition) GetClass() string {
return ClassMaskPosition
}
func (*MaskPosition) GetType() string {
return TypeMaskPosition
}
func (maskPosition *MaskPosition) UnmarshalJSON(data []byte) error {
var tmp struct {
Point json.RawMessage `json:"point"`
XShift float64 `json:"x_shift"`
YShift float64 `json:"y_shift"`
Scale float64 `json:"scale"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
maskPosition.XShift = tmp.XShift
maskPosition.YShift = tmp.YShift
maskPosition.Scale = tmp.Scale
fieldPoint, _ := UnmarshalMaskPoint(tmp.Point)
maskPosition.Point = fieldPoint
return nil
}
2023-06-04 22:58:07 +02:00
// The sticker is an image in WEBP format
type StickerFormatWebp struct {
2021-12-08 10:23:00 +01:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *StickerFormatWebp) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub StickerFormatWebp
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*StickerFormatWebp) GetClass() string {
return ClassStickerFormat
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*StickerFormatWebp) GetType() string {
return TypeStickerFormatWebp
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*StickerFormatWebp) StickerFormatType() string {
return TypeStickerFormatWebp
}
// The sticker is an animation in TGS format
type StickerFormatTgs struct {
meta
}
func (entity *StickerFormatTgs) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StickerFormatTgs
return json.Marshal((*stub)(entity))
}
func (*StickerFormatTgs) GetClass() string {
return ClassStickerFormat
}
func (*StickerFormatTgs) GetType() string {
return TypeStickerFormatTgs
}
func (*StickerFormatTgs) StickerFormatType() string {
return TypeStickerFormatTgs
}
// The sticker is a video in WEBM format
type StickerFormatWebm struct {
meta
}
func (entity *StickerFormatWebm) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StickerFormatWebm
return json.Marshal((*stub)(entity))
}
func (*StickerFormatWebm) GetClass() string {
return ClassStickerFormat
}
func (*StickerFormatWebm) GetType() string {
return TypeStickerFormatWebm
}
func (*StickerFormatWebm) StickerFormatType() string {
return TypeStickerFormatWebm
}
// The sticker is a regular sticker
type StickerTypeRegular struct {
meta
}
func (entity *StickerTypeRegular) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StickerTypeRegular
return json.Marshal((*stub)(entity))
}
func (*StickerTypeRegular) GetClass() string {
return ClassStickerType
}
func (*StickerTypeRegular) GetType() string {
return TypeStickerTypeRegular
}
func (*StickerTypeRegular) StickerTypeType() string {
return TypeStickerTypeRegular
}
// The sticker is a mask in WEBP format to be placed on photos or videos
type StickerTypeMask struct {
meta
}
func (entity *StickerTypeMask) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StickerTypeMask
return json.Marshal((*stub)(entity))
}
func (*StickerTypeMask) GetClass() string {
return ClassStickerType
}
func (*StickerTypeMask) GetType() string {
return TypeStickerTypeMask
}
func (*StickerTypeMask) StickerTypeType() string {
return TypeStickerTypeMask
}
// The sticker is a custom emoji to be used inside message text and caption
type StickerTypeCustomEmoji struct {
meta
}
func (entity *StickerTypeCustomEmoji) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StickerTypeCustomEmoji
return json.Marshal((*stub)(entity))
}
func (*StickerTypeCustomEmoji) GetClass() string {
return ClassStickerType
}
func (*StickerTypeCustomEmoji) GetType() string {
return TypeStickerTypeCustomEmoji
}
func (*StickerTypeCustomEmoji) StickerTypeType() string {
return TypeStickerTypeCustomEmoji
}
// The sticker is a regular sticker
type StickerFullTypeRegular struct {
meta
// Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker
PremiumAnimation *File `json:"premium_animation"`
}
func (entity *StickerFullTypeRegular) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StickerFullTypeRegular
return json.Marshal((*stub)(entity))
}
func (*StickerFullTypeRegular) GetClass() string {
return ClassStickerFullType
}
func (*StickerFullTypeRegular) GetType() string {
return TypeStickerFullTypeRegular
}
func (*StickerFullTypeRegular) StickerFullTypeType() string {
return TypeStickerFullTypeRegular
}
// The sticker is a mask in WEBP format to be placed on photos or videos
type StickerFullTypeMask struct {
meta
// Position where the mask is placed; may be null
MaskPosition *MaskPosition `json:"mask_position"`
}
func (entity *StickerFullTypeMask) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StickerFullTypeMask
return json.Marshal((*stub)(entity))
}
func (*StickerFullTypeMask) GetClass() string {
return ClassStickerFullType
}
func (*StickerFullTypeMask) GetType() string {
return TypeStickerFullTypeMask
}
func (*StickerFullTypeMask) StickerFullTypeType() string {
return TypeStickerFullTypeMask
}
// The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji
type StickerFullTypeCustomEmoji struct {
meta
// Identifier of the custom emoji
CustomEmojiId JsonInt64 `json:"custom_emoji_id"`
// True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, or another appropriate color in other places
NeedsRepainting bool `json:"needs_repainting"`
}
func (entity *StickerFullTypeCustomEmoji) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StickerFullTypeCustomEmoji
return json.Marshal((*stub)(entity))
}
func (*StickerFullTypeCustomEmoji) GetClass() string {
return ClassStickerFullType
}
func (*StickerFullTypeCustomEmoji) GetType() string {
return TypeStickerFullTypeCustomEmoji
}
func (*StickerFullTypeCustomEmoji) StickerFullTypeType() string {
return TypeStickerFullTypeCustomEmoji
}
// Represents a closed vector path. The path begins at the end point of the last command
type ClosedVectorPath struct {
meta
// List of vector path commands
Commands []VectorPathCommand `json:"commands"`
}
func (entity *ClosedVectorPath) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ClosedVectorPath
return json.Marshal((*stub)(entity))
}
func (*ClosedVectorPath) GetClass() string {
return ClassClosedVectorPath
}
func (*ClosedVectorPath) GetType() string {
return TypeClosedVectorPath
}
func (closedVectorPath *ClosedVectorPath) UnmarshalJSON(data []byte) error {
var tmp struct {
Commands []json.RawMessage `json:"commands"`
2021-12-08 10:23:00 +01:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldCommands, _ := UnmarshalListOfVectorPathCommand(tmp.Commands)
closedVectorPath.Commands = fieldCommands
return nil
}
2021-10-22 16:24:12 +02:00
// Describes one answer option of a poll
type PollOption struct {
meta
2021-12-08 10:23:00 +01:00
// Option text; 1-100 characters
2021-10-22 16:24:12 +02:00
Text string `json:"text"`
// Number of voters for this option, available only for closed or voted polls
VoterCount int32 `json:"voter_count"`
2021-12-08 10:23:00 +01:00
// The percentage of votes for this option; 0-100
2021-10-22 16:24:12 +02:00
VotePercentage int32 `json:"vote_percentage"`
// True, if the option was chosen by the user
IsChosen bool `json:"is_chosen"`
// True, if the option is being chosen by a pending setPollAnswer request
IsBeingChosen bool `json:"is_being_chosen"`
}
func (entity *PollOption) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PollOption
return json.Marshal((*stub)(entity))
}
func (*PollOption) GetClass() string {
return ClassPollOption
}
func (*PollOption) GetType() string {
return TypePollOption
}
// A regular poll
type PollTypeRegular struct {
meta
// True, if multiple answer options can be chosen simultaneously
AllowMultipleAnswers bool `json:"allow_multiple_answers"`
}
func (entity *PollTypeRegular) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PollTypeRegular
return json.Marshal((*stub)(entity))
}
func (*PollTypeRegular) GetClass() string {
return ClassPollType
}
func (*PollTypeRegular) GetType() string {
return TypePollTypeRegular
}
func (*PollTypeRegular) PollTypeType() string {
return TypePollTypeRegular
}
// A poll in quiz mode, which has exactly one correct answer option and can be answered only once
type PollTypeQuiz struct {
meta
// 0-based identifier of the correct answer option; -1 for a yet unanswered poll
CorrectOptionId int32 `json:"correct_option_id"`
2021-12-08 10:23:00 +01:00
// Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll
2021-10-22 16:24:12 +02:00
Explanation *FormattedText `json:"explanation"`
}
func (entity *PollTypeQuiz) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PollTypeQuiz
return json.Marshal((*stub)(entity))
}
func (*PollTypeQuiz) GetClass() string {
return ClassPollType
}
func (*PollTypeQuiz) GetType() string {
return TypePollTypeQuiz
}
func (*PollTypeQuiz) PollTypeType() string {
return TypePollTypeQuiz
}
// Describes an animation file. The animation must be encoded in GIF or MPEG4 format
type Animation struct {
meta
// Duration of the animation, in seconds; as defined by the sender
Duration int32 `json:"duration"`
// Width of the animation
Width int32 `json:"width"`
// Height of the animation
Height int32 `json:"height"`
// Original name of the file; as defined by the sender
FileName string `json:"file_name"`
// MIME type of the file, usually "image/gif" or "video/mp4"
MimeType string `json:"mime_type"`
// True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets
HasStickers bool `json:"has_stickers"`
// Animation minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Animation thumbnail in JPEG or MPEG4 format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
// File containing the animation
Animation *File `json:"animation"`
}
func (entity *Animation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Animation
return json.Marshal((*stub)(entity))
}
func (*Animation) GetClass() string {
return ClassAnimation
}
func (*Animation) GetType() string {
return TypeAnimation
}
// Describes an audio file. Audio is usually in MP3 or M4A format
type Audio struct {
meta
// Duration of the audio, in seconds; as defined by the sender
Duration int32 `json:"duration"`
// Title of the audio; as defined by the sender
Title string `json:"title"`
// Performer of the audio; as defined by the sender
Performer string `json:"performer"`
// Original name of the file; as defined by the sender
FileName string `json:"file_name"`
// The MIME type of the file; as defined by the sender
MimeType string `json:"mime_type"`
// The minithumbnail of the album cover; may be null
AlbumCoverMinithumbnail *Minithumbnail `json:"album_cover_minithumbnail"`
2023-06-04 22:58:07 +02:00
// The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded audio file; may be null
2021-10-22 16:24:12 +02:00
AlbumCoverThumbnail *Thumbnail `json:"album_cover_thumbnail"`
2023-06-04 22:58:07 +02:00
// Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate
ExternalAlbumCovers []*Thumbnail `json:"external_album_covers"`
2021-10-22 16:24:12 +02:00
// File containing the audio
Audio *File `json:"audio"`
}
func (entity *Audio) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Audio
return json.Marshal((*stub)(entity))
}
func (*Audio) GetClass() string {
return ClassAudio
}
func (*Audio) GetType() string {
return TypeAudio
}
// Describes a document of any type
type Document struct {
meta
// Original name of the file; as defined by the sender
FileName string `json:"file_name"`
// MIME type of the file; as defined by the sender
MimeType string `json:"mime_type"`
// Document minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
// File containing the document
Document *File `json:"document"`
}
func (entity *Document) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Document
return json.Marshal((*stub)(entity))
}
func (*Document) GetClass() string {
return ClassDocument
}
func (*Document) GetType() string {
return TypeDocument
}
// Describes a photo
type Photo struct {
meta
// True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets
HasStickers bool `json:"has_stickers"`
// Photo minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Available variants of the photo, in different sizes
Sizes []*PhotoSize `json:"sizes"`
}
func (entity *Photo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Photo
return json.Marshal((*stub)(entity))
}
func (*Photo) GetClass() string {
return ClassPhoto
}
func (*Photo) GetType() string {
return TypePhoto
}
// Describes a sticker
type Sticker struct {
meta
// The identifier of the sticker set to which the sticker belongs; 0 if none
SetId JsonInt64 `json:"set_id"`
// Sticker width; as defined by the sender
Width int32 `json:"width"`
// Sticker height; as defined by the sender
Height int32 `json:"height"`
// Emoji corresponding to the sticker
Emoji string `json:"emoji"`
2023-06-04 22:58:07 +02:00
// Sticker format
Format StickerFormat `json:"format"`
// Sticker's full type
FullType StickerFullType `json:"full_type"`
2021-12-08 10:23:00 +01:00
// Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
Outline []*ClosedVectorPath `json:"outline"`
2021-10-22 16:24:12 +02:00
// Sticker thumbnail in WEBP or JPEG format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
// File containing the sticker
Sticker *File `json:"sticker"`
}
func (entity *Sticker) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Sticker
return json.Marshal((*stub)(entity))
}
func (*Sticker) GetClass() string {
return ClassSticker
}
func (*Sticker) GetType() string {
return TypeSticker
}
2023-06-04 22:58:07 +02:00
func (sticker *Sticker) UnmarshalJSON(data []byte) error {
var tmp struct {
SetId JsonInt64 `json:"set_id"`
Width int32 `json:"width"`
Height int32 `json:"height"`
Emoji string `json:"emoji"`
Format json.RawMessage `json:"format"`
FullType json.RawMessage `json:"full_type"`
Outline []*ClosedVectorPath `json:"outline"`
Thumbnail *Thumbnail `json:"thumbnail"`
Sticker *File `json:"sticker"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
sticker.SetId = tmp.SetId
sticker.Width = tmp.Width
sticker.Height = tmp.Height
sticker.Emoji = tmp.Emoji
sticker.Outline = tmp.Outline
sticker.Thumbnail = tmp.Thumbnail
sticker.Sticker = tmp.Sticker
fieldFormat, _ := UnmarshalStickerFormat(tmp.Format)
sticker.Format = fieldFormat
fieldFullType, _ := UnmarshalStickerFullType(tmp.FullType)
sticker.FullType = fieldFullType
return nil
}
2021-10-22 16:24:12 +02:00
// Describes a video file
type Video struct {
meta
// Duration of the video, in seconds; as defined by the sender
Duration int32 `json:"duration"`
// Video width; as defined by the sender
Width int32 `json:"width"`
// Video height; as defined by the sender
Height int32 `json:"height"`
// Original name of the file; as defined by the sender
FileName string `json:"file_name"`
// MIME type of the file; as defined by the sender
MimeType string `json:"mime_type"`
// True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets
HasStickers bool `json:"has_stickers"`
2021-12-08 10:23:00 +01:00
// True, if the video is supposed to be streamed
2021-10-22 16:24:12 +02:00
SupportsStreaming bool `json:"supports_streaming"`
// Video minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
// File containing the video
Video *File `json:"video"`
}
func (entity *Video) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Video
return json.Marshal((*stub)(entity))
}
func (*Video) GetClass() string {
return ClassVideo
}
func (*Video) GetType() string {
return TypeVideo
}
// Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format
type VideoNote struct {
meta
// Duration of the video, in seconds; as defined by the sender
Duration int32 `json:"duration"`
2023-06-04 22:58:07 +02:00
// A waveform representation of the video note's audio in 5-bit format; may be empty if unknown
Waveform []byte `json:"waveform"`
2021-10-22 16:24:12 +02:00
// Video width and height; as defined by the sender
Length int32 `json:"length"`
// Video minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Video thumbnail in JPEG format; as defined by the sender; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
2023-06-04 22:58:07 +02:00
// Result of speech recognition in the video note; may be null
SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"`
2021-10-22 16:24:12 +02:00
// File containing the video
Video *File `json:"video"`
}
func (entity *VideoNote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub VideoNote
return json.Marshal((*stub)(entity))
}
func (*VideoNote) GetClass() string {
return ClassVideoNote
}
func (*VideoNote) GetType() string {
return TypeVideoNote
}
2023-06-04 22:58:07 +02:00
func (videoNote *VideoNote) UnmarshalJSON(data []byte) error {
var tmp struct {
Duration int32 `json:"duration"`
Waveform []byte `json:"waveform"`
Length int32 `json:"length"`
Minithumbnail *Minithumbnail `json:"minithumbnail"`
Thumbnail *Thumbnail `json:"thumbnail"`
SpeechRecognitionResult json.RawMessage `json:"speech_recognition_result"`
Video *File `json:"video"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
videoNote.Duration = tmp.Duration
videoNote.Waveform = tmp.Waveform
videoNote.Length = tmp.Length
videoNote.Minithumbnail = tmp.Minithumbnail
videoNote.Thumbnail = tmp.Thumbnail
videoNote.Video = tmp.Video
fieldSpeechRecognitionResult, _ := UnmarshalSpeechRecognitionResult(tmp.SpeechRecognitionResult)
videoNote.SpeechRecognitionResult = fieldSpeechRecognitionResult
return nil
}
2021-10-22 16:24:12 +02:00
// Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel
type VoiceNote struct {
meta
// Duration of the voice note, in seconds; as defined by the sender
Duration int32 `json:"duration"`
// A waveform representation of the voice note in 5-bit format
Waveform []byte `json:"waveform"`
// MIME type of the file; as defined by the sender
MimeType string `json:"mime_type"`
2023-06-04 22:58:07 +02:00
// Result of speech recognition in the voice note; may be null
SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"`
2021-10-22 16:24:12 +02:00
// File containing the voice note
Voice *File `json:"voice"`
}
func (entity *VoiceNote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub VoiceNote
return json.Marshal((*stub)(entity))
}
func (*VoiceNote) GetClass() string {
return ClassVoiceNote
}
func (*VoiceNote) GetType() string {
return TypeVoiceNote
}
2023-06-04 22:58:07 +02:00
func (voiceNote *VoiceNote) UnmarshalJSON(data []byte) error {
var tmp struct {
Duration int32 `json:"duration"`
Waveform []byte `json:"waveform"`
MimeType string `json:"mime_type"`
SpeechRecognitionResult json.RawMessage `json:"speech_recognition_result"`
Voice *File `json:"voice"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
voiceNote.Duration = tmp.Duration
voiceNote.Waveform = tmp.Waveform
voiceNote.MimeType = tmp.MimeType
voiceNote.Voice = tmp.Voice
fieldSpeechRecognitionResult, _ := UnmarshalSpeechRecognitionResult(tmp.SpeechRecognitionResult)
voiceNote.SpeechRecognitionResult = fieldSpeechRecognitionResult
return nil
}
// Describes an animated or custom representation of an emoji
2021-12-08 10:23:00 +01:00
type AnimatedEmoji struct {
meta
2023-06-04 22:58:07 +02:00
// Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs
2021-12-08 10:23:00 +01:00
Sticker *Sticker `json:"sticker"`
2023-06-04 22:58:07 +02:00
// Expected width of the sticker, which can be used if the sticker is null
StickerWidth int32 `json:"sticker_width"`
// Expected height of the sticker, which can be used if the sticker is null
StickerHeight int32 `json:"sticker_height"`
2021-12-08 10:23:00 +01:00
// Emoji modifier fitzpatrick type; 0-6; 0 if none
FitzpatrickType int32 `json:"fitzpatrick_type"`
2023-06-04 22:58:07 +02:00
// File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container
2021-12-08 10:23:00 +01:00
Sound *File `json:"sound"`
}
func (entity *AnimatedEmoji) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AnimatedEmoji
return json.Marshal((*stub)(entity))
}
func (*AnimatedEmoji) GetClass() string {
return ClassAnimatedEmoji
}
func (*AnimatedEmoji) GetType() string {
return TypeAnimatedEmoji
}
2021-10-22 16:24:12 +02:00
// Describes a user contact
type Contact struct {
meta
// Phone number of the user
PhoneNumber string `json:"phone_number"`
// First name of the user; 1-255 characters in length
FirstName string `json:"first_name"`
// Last name of the user
LastName string `json:"last_name"`
// Additional data about the user in a form of vCard; 0-2048 bytes in length
Vcard string `json:"vcard"`
// Identifier of the user, if known; otherwise 0
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
}
func (entity *Contact) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Contact
return json.Marshal((*stub)(entity))
}
func (*Contact) GetClass() string {
return ClassContact
}
func (*Contact) GetType() string {
return TypeContact
}
// Describes a location on planet Earth
type Location struct {
meta
// Latitude of the location in degrees; as defined by the sender
Latitude float64 `json:"latitude"`
// Longitude of the location, in degrees; as defined by the sender
Longitude float64 `json:"longitude"`
// The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown
HorizontalAccuracy float64 `json:"horizontal_accuracy"`
}
func (entity *Location) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Location
return json.Marshal((*stub)(entity))
}
func (*Location) GetClass() string {
return ClassLocation
}
func (*Location) GetType() string {
return TypeLocation
}
// Describes a venue
type Venue struct {
meta
// Venue location; as defined by the sender
Location *Location `json:"location"`
// Venue name; as defined by the sender
Title string `json:"title"`
// Venue address; as defined by the sender
Address string `json:"address"`
2022-04-18 22:45:01 +02:00
// Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported
2021-10-22 16:24:12 +02:00
Provider string `json:"provider"`
// Identifier of the venue in the provider database; as defined by the sender
Id string `json:"id"`
// Type of the venue in the provider database; as defined by the sender
Type string `json:"type"`
}
func (entity *Venue) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Venue
return json.Marshal((*stub)(entity))
}
func (*Venue) GetClass() string {
return ClassVenue
}
func (*Venue) GetType() string {
return TypeVenue
}
// Describes a game
type Game struct {
meta
2023-06-04 22:58:07 +02:00
// Unique game identifier
2021-10-22 16:24:12 +02:00
Id JsonInt64 `json:"id"`
// Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name}
ShortName string `json:"short_name"`
// Game title
Title string `json:"title"`
// Game text, usually containing scoreboards for a game
Text *FormattedText `json:"text"`
// Game description
Description string `json:"description"`
// Game photo
Photo *Photo `json:"photo"`
// Game animation; may be null
Animation *Animation `json:"animation"`
}
func (entity *Game) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Game
return json.Marshal((*stub)(entity))
}
func (*Game) GetClass() string {
return ClassGame
}
func (*Game) GetType() string {
return TypeGame
}
// Describes a poll
type Poll struct {
meta
// Unique poll identifier
Id JsonInt64 `json:"id"`
2021-12-08 10:23:00 +01:00
// Poll question; 1-300 characters
2021-10-22 16:24:12 +02:00
Question string `json:"question"`
// List of poll answer options
Options []*PollOption `json:"options"`
// Total number of voters, participating in the poll
TotalVoterCount int32 `json:"total_voter_count"`
// User identifiers of recent voters, if the poll is non-anonymous
2021-12-08 10:23:00 +01:00
RecentVoterUserIds []int64 `json:"recent_voter_user_ids"`
2021-10-22 16:24:12 +02:00
// True, if the poll is anonymous
IsAnonymous bool `json:"is_anonymous"`
// Type of the poll
Type PollType `json:"type"`
// Amount of time the poll will be active after creation, in seconds
OpenPeriod int32 `json:"open_period"`
2021-12-08 10:23:00 +01:00
// Point in time (Unix timestamp) when the poll will automatically be closed
2021-10-22 16:24:12 +02:00
CloseDate int32 `json:"close_date"`
// True, if the poll is closed
IsClosed bool `json:"is_closed"`
}
func (entity *Poll) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Poll
return json.Marshal((*stub)(entity))
}
func (*Poll) GetClass() string {
return ClassPoll
}
func (*Poll) GetType() string {
return TypePoll
}
func (poll *Poll) UnmarshalJSON(data []byte) error {
var tmp struct {
Id JsonInt64 `json:"id"`
Question string `json:"question"`
Options []*PollOption `json:"options"`
TotalVoterCount int32 `json:"total_voter_count"`
2021-12-08 10:23:00 +01:00
RecentVoterUserIds []int64 `json:"recent_voter_user_ids"`
2021-10-22 16:24:12 +02:00
IsAnonymous bool `json:"is_anonymous"`
Type json.RawMessage `json:"type"`
OpenPeriod int32 `json:"open_period"`
CloseDate int32 `json:"close_date"`
IsClosed bool `json:"is_closed"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
poll.Id = tmp.Id
poll.Question = tmp.Question
poll.Options = tmp.Options
poll.TotalVoterCount = tmp.TotalVoterCount
poll.RecentVoterUserIds = tmp.RecentVoterUserIds
poll.IsAnonymous = tmp.IsAnonymous
poll.OpenPeriod = tmp.OpenPeriod
poll.CloseDate = tmp.CloseDate
poll.IsClosed = tmp.IsClosed
fieldType, _ := UnmarshalPollType(tmp.Type)
poll.Type = fieldType
return nil
}
// Describes a user profile photo
type ProfilePhoto struct {
meta
// Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos
Id JsonInt64 `json:"id"`
// A small (160x160) user profile photo. The file can be downloaded only before the photo is changed
Small *File `json:"small"`
// A big (640x640) user profile photo. The file can be downloaded only before the photo is changed
Big *File `json:"big"`
2021-12-08 10:23:00 +01:00
// User profile photo minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
2021-10-22 16:24:12 +02:00
// True, if the photo has animated variant
HasAnimation bool `json:"has_animation"`
2023-06-04 22:58:07 +02:00
// True, if the photo is visible only for the current user
IsPersonal bool `json:"is_personal"`
2021-10-22 16:24:12 +02:00
}
func (entity *ProfilePhoto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ProfilePhoto
return json.Marshal((*stub)(entity))
}
func (*ProfilePhoto) GetClass() string {
return ClassProfilePhoto
}
func (*ProfilePhoto) GetType() string {
return TypeProfilePhoto
}
// Contains basic information about the photo of a chat
type ChatPhotoInfo struct {
meta
// A small (160x160) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed
Small *File `json:"small"`
// A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed
Big *File `json:"big"`
2021-12-08 10:23:00 +01:00
// Chat photo minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
2021-10-22 16:24:12 +02:00
// True, if the photo has animated variant
HasAnimation bool `json:"has_animation"`
2023-06-04 22:58:07 +02:00
// True, if the photo is visible only for the current user
IsPersonal bool `json:"is_personal"`
2021-10-22 16:24:12 +02:00
}
func (entity *ChatPhotoInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatPhotoInfo
return json.Marshal((*stub)(entity))
}
func (*ChatPhotoInfo) GetClass() string {
return ClassChatPhotoInfo
}
func (*ChatPhotoInfo) GetType() string {
return TypeChatPhotoInfo
}
// A regular user
type UserTypeRegular struct {
meta
}
func (entity *UserTypeRegular) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UserTypeRegular
return json.Marshal((*stub)(entity))
}
func (*UserTypeRegular) GetClass() string {
return ClassUserType
}
func (*UserTypeRegular) GetType() string {
return TypeUserTypeRegular
}
func (*UserTypeRegular) UserTypeType() string {
return TypeUserTypeRegular
}
// A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user
type UserTypeDeleted struct {
meta
}
func (entity *UserTypeDeleted) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UserTypeDeleted
return json.Marshal((*stub)(entity))
}
func (*UserTypeDeleted) GetClass() string {
return ClassUserType
}
func (*UserTypeDeleted) GetType() string {
return TypeUserTypeDeleted
}
func (*UserTypeDeleted) UserTypeType() string {
return TypeUserTypeDeleted
}
// A bot (see https://core.telegram.org/bots)
type UserTypeBot struct {
meta
// True, if the bot can be invited to basic group and supergroup chats
CanJoinGroups bool `json:"can_join_groups"`
// True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages
CanReadAllGroupMessages bool `json:"can_read_all_group_messages"`
// True, if the bot supports inline queries
IsInline bool `json:"is_inline"`
// Placeholder for inline queries (displayed on the application input field)
InlineQueryPlaceholder string `json:"inline_query_placeholder"`
2021-12-08 10:23:00 +01:00
// True, if the location of the user is expected to be sent with every inline query to this bot
2021-10-22 16:24:12 +02:00
NeedLocation bool `json:"need_location"`
2023-06-04 22:58:07 +02:00
// True, if the bot can be added to attachment menu
CanBeAddedToAttachmentMenu bool `json:"can_be_added_to_attachment_menu"`
2021-10-22 16:24:12 +02:00
}
func (entity *UserTypeBot) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UserTypeBot
return json.Marshal((*stub)(entity))
}
func (*UserTypeBot) GetClass() string {
return ClassUserType
}
func (*UserTypeBot) GetType() string {
return TypeUserTypeBot
}
func (*UserTypeBot) UserTypeType() string {
return TypeUserTypeBot
}
// No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type
type UserTypeUnknown struct {
meta
}
func (entity *UserTypeUnknown) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UserTypeUnknown
return json.Marshal((*stub)(entity))
}
func (*UserTypeUnknown) GetClass() string {
return ClassUserType
}
func (*UserTypeUnknown) GetType() string {
return TypeUserTypeUnknown
}
func (*UserTypeUnknown) UserTypeType() string {
return TypeUserTypeUnknown
}
// Represents a command supported by a bot
type BotCommand struct {
meta
// Text of the bot command
Command string `json:"command"`
// Description of the bot command
Description string `json:"description"`
}
func (entity *BotCommand) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BotCommand
return json.Marshal((*stub)(entity))
}
func (*BotCommand) GetClass() string {
return ClassBotCommand
}
func (*BotCommand) GetType() string {
return TypeBotCommand
}
2021-12-08 10:23:00 +01:00
// Contains a list of bot commands
type BotCommands struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Bot's user identifier
BotUserId int64 `json:"bot_user_id"`
// List of bot commands
2021-10-22 16:24:12 +02:00
Commands []*BotCommand `json:"commands"`
}
2021-12-08 10:23:00 +01:00
func (entity *BotCommands) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub BotCommands
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*BotCommands) GetClass() string {
return ClassBotCommands
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*BotCommands) GetType() string {
return TypeBotCommands
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Describes a button to be shown instead of bot commands menu button
type BotMenuButton struct {
meta
// Text of the button
Text string `json:"text"`
// URL to be passed to openWebApp
Url string `json:"url"`
}
func (entity *BotMenuButton) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BotMenuButton
return json.Marshal((*stub)(entity))
}
func (*BotMenuButton) GetClass() string {
return ClassBotMenuButton
}
func (*BotMenuButton) GetType() string {
return TypeBotMenuButton
}
2021-10-22 16:24:12 +02:00
// Represents a location to which a chat is connected
type ChatLocation struct {
meta
// The location
Location *Location `json:"location"`
// Location address; 1-64 characters, as defined by the chat owner
Address string `json:"address"`
}
func (entity *ChatLocation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatLocation
return json.Marshal((*stub)(entity))
}
func (*ChatLocation) GetClass() string {
return ClassChatLocation
}
func (*ChatLocation) GetType() string {
return TypeChatLocation
}
// Animated variant of a chat photo in MPEG4 format
type AnimatedChatPhoto struct {
meta
// Animation width and height
Length int32 `json:"length"`
// Information about the animation file
File *File `json:"file"`
// Timestamp of the frame, used as a static chat photo
MainFrameTimestamp float64 `json:"main_frame_timestamp"`
}
func (entity *AnimatedChatPhoto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AnimatedChatPhoto
return json.Marshal((*stub)(entity))
}
func (*AnimatedChatPhoto) GetClass() string {
return ClassAnimatedChatPhoto
}
func (*AnimatedChatPhoto) GetType() string {
return TypeAnimatedChatPhoto
}
// Describes a chat or user profile photo
type ChatPhoto struct {
meta
// Unique photo identifier
Id JsonInt64 `json:"id"`
// Point in time (Unix timestamp) when the photo has been added
AddedDate int32 `json:"added_date"`
// Photo minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Available variants of the photo in JPEG format, in different size
Sizes []*PhotoSize `json:"sizes"`
2023-06-04 22:58:07 +02:00
// A big (640x640) animated variant of the photo in MPEG4 format; may be null
2021-10-22 16:24:12 +02:00
Animation *AnimatedChatPhoto `json:"animation"`
2023-06-04 22:58:07 +02:00
// A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available
SmallAnimation *AnimatedChatPhoto `json:"small_animation"`
2021-10-22 16:24:12 +02:00
}
func (entity *ChatPhoto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatPhoto
return json.Marshal((*stub)(entity))
}
func (*ChatPhoto) GetClass() string {
return ClassChatPhoto
}
func (*ChatPhoto) GetType() string {
return TypeChatPhoto
}
// Contains a list of chat or user profile photos
type ChatPhotos struct {
meta
// Total number of photos
TotalCount int32 `json:"total_count"`
// List of photos
Photos []*ChatPhoto `json:"photos"`
}
func (entity *ChatPhotos) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatPhotos
return json.Marshal((*stub)(entity))
}
func (*ChatPhotos) GetClass() string {
return ClassChatPhotos
}
func (*ChatPhotos) GetType() string {
return TypeChatPhotos
}
// A previously used profile photo of the current user
type InputChatPhotoPrevious struct {
meta
2021-12-08 10:23:00 +01:00
// Identifier of the current user's profile photo to reuse
2021-10-22 16:24:12 +02:00
ChatPhotoId JsonInt64 `json:"chat_photo_id"`
}
func (entity *InputChatPhotoPrevious) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputChatPhotoPrevious
return json.Marshal((*stub)(entity))
}
func (*InputChatPhotoPrevious) GetClass() string {
return ClassInputChatPhoto
}
func (*InputChatPhotoPrevious) GetType() string {
return TypeInputChatPhotoPrevious
}
func (*InputChatPhotoPrevious) InputChatPhotoType() string {
return TypeInputChatPhotoPrevious
}
// A static photo in JPEG format
type InputChatPhotoStatic struct {
meta
// Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed
Photo InputFile `json:"photo"`
}
func (entity *InputChatPhotoStatic) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputChatPhotoStatic
return json.Marshal((*stub)(entity))
}
func (*InputChatPhotoStatic) GetClass() string {
return ClassInputChatPhoto
}
func (*InputChatPhotoStatic) GetType() string {
return TypeInputChatPhotoStatic
}
func (*InputChatPhotoStatic) InputChatPhotoType() string {
return TypeInputChatPhotoStatic
}
func (inputChatPhotoStatic *InputChatPhotoStatic) UnmarshalJSON(data []byte) error {
var tmp struct {
Photo json.RawMessage `json:"photo"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldPhoto, _ := UnmarshalInputFile(tmp.Photo)
inputChatPhotoStatic.Photo = fieldPhoto
return nil
}
// An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 800 and be at most 2MB in size
type InputChatPhotoAnimation struct {
meta
// Animation to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed
Animation InputFile `json:"animation"`
// Timestamp of the frame, which will be used as static chat photo
MainFrameTimestamp float64 `json:"main_frame_timestamp"`
}
func (entity *InputChatPhotoAnimation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputChatPhotoAnimation
return json.Marshal((*stub)(entity))
}
func (*InputChatPhotoAnimation) GetClass() string {
return ClassInputChatPhoto
}
func (*InputChatPhotoAnimation) GetType() string {
return TypeInputChatPhotoAnimation
}
func (*InputChatPhotoAnimation) InputChatPhotoType() string {
return TypeInputChatPhotoAnimation
}
func (inputChatPhotoAnimation *InputChatPhotoAnimation) UnmarshalJSON(data []byte) error {
var tmp struct {
Animation json.RawMessage `json:"animation"`
MainFrameTimestamp float64 `json:"main_frame_timestamp"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputChatPhotoAnimation.MainFrameTimestamp = tmp.MainFrameTimestamp
fieldAnimation, _ := UnmarshalInputFile(tmp.Animation)
inputChatPhotoAnimation.Animation = fieldAnimation
return nil
}
2023-06-04 22:58:07 +02:00
// Describes actions that a user is allowed to take in a chat
type ChatPermissions struct {
2022-04-18 22:45:01 +02:00
meta
2023-06-04 22:58:07 +02:00
// True, if the user can send text messages, contacts, locations, and venues
CanSendMessages bool `json:"can_send_messages"`
// True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions
CanSendMediaMessages bool `json:"can_send_media_messages"`
// True, if the user can send polls. Implies can_send_messages permissions
CanSendPolls bool `json:"can_send_polls"`
// True, if the user can send animations, games, stickers, and dice and use inline bots. Implies can_send_messages permissions
CanSendOtherMessages bool `json:"can_send_other_messages"`
// True, if the user may add a web page preview to their messages. Implies can_send_messages permissions
CanAddWebPagePreviews bool `json:"can_add_web_page_previews"`
// 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
CanInviteUsers bool `json:"can_invite_users"`
// True, if the user can pin messages
CanPinMessages bool `json:"can_pin_messages"`
// True, if the user can manage topics
CanManageTopics bool `json:"can_manage_topics"`
}
func (entity *ChatPermissions) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatPermissions
return json.Marshal((*stub)(entity))
}
func (*ChatPermissions) GetClass() string {
return ClassChatPermissions
}
func (*ChatPermissions) GetType() string {
return TypeChatPermissions
}
// Describes rights of the administrator
type ChatAdministratorRights struct {
meta
// True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only
CanManageChat bool `json:"can_manage_chat"`
// True, if the administrator can change the chat title, photo, and other settings
CanChangeInfo bool `json:"can_change_info"`
// True, if the administrator can create channel posts; applicable to channels only
CanPostMessages bool `json:"can_post_messages"`
// True, if the administrator can edit messages of other users and pin messages; applicable to channels only
CanEditMessages bool `json:"can_edit_messages"`
// True, if the administrator can delete messages of other users
CanDeleteMessages bool `json:"can_delete_messages"`
// True, if the administrator can invite new users to the chat
CanInviteUsers bool `json:"can_invite_users"`
// True, if the administrator can restrict, ban, or unban chat members; always true for channels
CanRestrictMembers bool `json:"can_restrict_members"`
// True, if the administrator can pin messages; applicable to basic groups and supergroups only
CanPinMessages bool `json:"can_pin_messages"`
// True, if the administrator can manage topics; applicable to forum supergroups only
CanManageTopics bool `json:"can_manage_topics"`
// True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them
CanPromoteMembers bool `json:"can_promote_members"`
// True, if the administrator can manage video chats
CanManageVideoChats bool `json:"can_manage_video_chats"`
// 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"`
}
func (entity *ChatAdministratorRights) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatAdministratorRights
return json.Marshal((*stub)(entity))
}
func (*ChatAdministratorRights) GetClass() string {
return ClassChatAdministratorRights
}
func (*ChatAdministratorRights) GetType() string {
return TypeChatAdministratorRights
}
// Describes an option for buying Telegram Premium to a user
type PremiumPaymentOption struct {
meta
// ISO 4217 currency code for Telegram Premium subscription payment
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 month the Telegram Premium subscription will be active
MonthCount int32 `json:"month_count"`
// Identifier of the store product associated with the option
StoreProductId string `json:"store_product_id"`
// An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available
PaymentLink InternalLinkType `json:"payment_link"`
}
func (entity *PremiumPaymentOption) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PremiumPaymentOption
return json.Marshal((*stub)(entity))
}
func (*PremiumPaymentOption) GetClass() string {
return ClassPremiumPaymentOption
}
func (*PremiumPaymentOption) GetType() string {
return TypePremiumPaymentOption
}
func (premiumPaymentOption *PremiumPaymentOption) UnmarshalJSON(data []byte) error {
var tmp struct {
Currency string `json:"currency"`
Amount int64 `json:"amount"`
DiscountPercentage int32 `json:"discount_percentage"`
MonthCount int32 `json:"month_count"`
StoreProductId string `json:"store_product_id"`
PaymentLink json.RawMessage `json:"payment_link"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
premiumPaymentOption.Currency = tmp.Currency
premiumPaymentOption.Amount = tmp.Amount
premiumPaymentOption.DiscountPercentage = tmp.DiscountPercentage
premiumPaymentOption.MonthCount = tmp.MonthCount
premiumPaymentOption.StoreProductId = tmp.StoreProductId
fieldPaymentLink, _ := UnmarshalInternalLinkType(tmp.PaymentLink)
premiumPaymentOption.PaymentLink = fieldPaymentLink
return nil
}
// Describes a custom emoji to be shown instead of the Telegram Premium badge
type EmojiStatus struct {
meta
// Identifier of the custom emoji in stickerFormatTgs format
CustomEmojiId JsonInt64 `json:"custom_emoji_id"`
}
func (entity *EmojiStatus) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub EmojiStatus
return json.Marshal((*stub)(entity))
}
func (*EmojiStatus) GetClass() string {
return ClassEmojiStatus
}
func (*EmojiStatus) GetType() string {
return TypeEmojiStatus
}
// Contains a list of emoji statuses
type EmojiStatuses struct {
meta
// The list of emoji statuses
EmojiStatuses []*EmojiStatus `json:"emoji_statuses"`
}
func (entity *EmojiStatuses) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub EmojiStatuses
return json.Marshal((*stub)(entity))
}
func (*EmojiStatuses) GetClass() string {
return ClassEmojiStatuses
}
func (*EmojiStatuses) GetType() string {
return TypeEmojiStatuses
}
// Describes usernames assigned to a user, a supergroup, or a channel
type Usernames struct {
meta
// List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames
ActiveUsernames []string `json:"active_usernames"`
// List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive
DisabledUsernames []string `json:"disabled_usernames"`
// The active username, which can be changed with setUsername/setSupergroupUsername
EditableUsername string `json:"editable_username"`
}
func (entity *Usernames) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Usernames
return json.Marshal((*stub)(entity))
}
func (*Usernames) GetClass() string {
return ClassUsernames
}
func (*Usernames) GetType() string {
return TypeUsernames
}
// Represents a user
type User struct {
meta
// User identifier
Id int64 `json:"id"`
// First name of the user
FirstName string `json:"first_name"`
// Last name of the user
LastName string `json:"last_name"`
// Usernames of the user; may be null
Usernames *Usernames `json:"usernames"`
// Phone number of the user
PhoneNumber string `json:"phone_number"`
// Current online status of the user
Status UserStatus `json:"status"`
// Profile photo of the user; may be null
ProfilePhoto *ProfilePhoto `json:"profile_photo"`
// Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only
EmojiStatus *EmojiStatus `json:"emoji_status"`
// The user is a contact of the current user
IsContact bool `json:"is_contact"`
// The user is a contact of the current user and the current user is a contact of the user
IsMutualContact bool `json:"is_mutual_contact"`
// True, if the user is verified
IsVerified bool `json:"is_verified"`
// True, if the user is a Telegram Premium user
IsPremium bool `json:"is_premium"`
// True, if the user is Telegram support account
IsSupport bool `json:"is_support"`
// If non-empty, it contains a human-readable description of the reason why access to this user must be restricted
RestrictionReason string `json:"restriction_reason"`
// True, if many users reported this user as a scam
IsScam bool `json:"is_scam"`
// True, if many users reported this user as a fake account
IsFake bool `json:"is_fake"`
// If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method
HaveAccess bool `json:"have_access"`
// Type of the user
Type UserType `json:"type"`
// IETF language tag of the user's language; only available to bots
LanguageCode string `json:"language_code"`
// True, if the user added the current bot to attachment menu; only available to bots
AddedToAttachmentMenu bool `json:"added_to_attachment_menu"`
}
func (entity *User) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub User
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
func (*User) GetClass() string {
return ClassUser
}
func (*User) GetType() string {
return TypeUser
}
func (user *User) UnmarshalJSON(data []byte) error {
var tmp struct {
2023-06-04 22:58:07 +02:00
Id int64 `json:"id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Usernames *Usernames `json:"usernames"`
PhoneNumber string `json:"phone_number"`
Status json.RawMessage `json:"status"`
ProfilePhoto *ProfilePhoto `json:"profile_photo"`
EmojiStatus *EmojiStatus `json:"emoji_status"`
IsContact bool `json:"is_contact"`
IsMutualContact bool `json:"is_mutual_contact"`
IsVerified bool `json:"is_verified"`
IsPremium bool `json:"is_premium"`
IsSupport bool `json:"is_support"`
RestrictionReason string `json:"restriction_reason"`
IsScam bool `json:"is_scam"`
IsFake bool `json:"is_fake"`
HaveAccess bool `json:"have_access"`
Type json.RawMessage `json:"type"`
LanguageCode string `json:"language_code"`
AddedToAttachmentMenu bool `json:"added_to_attachment_menu"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
user.Id = tmp.Id
user.FirstName = tmp.FirstName
user.LastName = tmp.LastName
2023-06-04 22:58:07 +02:00
user.Usernames = tmp.Usernames
2021-10-22 16:24:12 +02:00
user.PhoneNumber = tmp.PhoneNumber
user.ProfilePhoto = tmp.ProfilePhoto
2023-06-04 22:58:07 +02:00
user.EmojiStatus = tmp.EmojiStatus
2021-10-22 16:24:12 +02:00
user.IsContact = tmp.IsContact
user.IsMutualContact = tmp.IsMutualContact
user.IsVerified = tmp.IsVerified
2023-06-04 22:58:07 +02:00
user.IsPremium = tmp.IsPremium
2021-10-22 16:24:12 +02:00
user.IsSupport = tmp.IsSupport
user.RestrictionReason = tmp.RestrictionReason
user.IsScam = tmp.IsScam
2021-12-08 10:23:00 +01:00
user.IsFake = tmp.IsFake
2021-10-22 16:24:12 +02:00
user.HaveAccess = tmp.HaveAccess
user.LanguageCode = tmp.LanguageCode
2023-06-04 22:58:07 +02:00
user.AddedToAttachmentMenu = tmp.AddedToAttachmentMenu
2021-10-22 16:24:12 +02:00
fieldStatus, _ := UnmarshalUserStatus(tmp.Status)
user.Status = fieldStatus
fieldType, _ := UnmarshalUserType(tmp.Type)
user.Type = fieldType
return nil
}
2023-06-04 22:58:07 +02:00
// Contains information about a bot
type BotInfo struct {
meta
// The text that is shown on the bot's profile page and is sent together with the link when users share the bot
ShareText string `json:"share_text"`
// The text shown in the chat with the bot if the chat is empty
Description string `json:"description"`
// Photo shown in the chat with the bot if the chat is empty; may be null
Photo *Photo `json:"photo"`
// Animation shown in the chat with the bot if the chat is empty; may be null
Animation *Animation `json:"animation"`
// Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown
MenuButton *BotMenuButton `json:"menu_button"`
// List of the bot commands
Commands []*BotCommand `json:"commands"`
// Default administrator rights for adding the bot to basic group and supergroup chats; may be null
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"`
}
func (entity *BotInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BotInfo
return json.Marshal((*stub)(entity))
}
func (*BotInfo) GetClass() string {
return ClassBotInfo
}
func (*BotInfo) GetType() string {
return TypeBotInfo
}
2021-10-22 16:24:12 +02:00
// Contains full information about a user
type UserFullInfo struct {
meta
2023-06-04 22:58:07 +02:00
// User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos
PersonalPhoto *ChatPhoto `json:"personal_photo"`
// User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo
2021-10-22 16:24:12 +02:00
Photo *ChatPhoto `json:"photo"`
2023-06-04 22:58:07 +02:00
// User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty, otherwise unknown. If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos
PublicPhoto *ChatPhoto `json:"public_photo"`
2021-10-22 16:24:12 +02:00
// True, if the user is blocked by the current user
IsBlocked bool `json:"is_blocked"`
// True, if the user can be called
CanBeCalled bool `json:"can_be_called"`
// True, if a video call can be created with the user
SupportsVideoCalls bool `json:"supports_video_calls"`
// True, if the user can't be called due to their privacy settings
HasPrivateCalls bool `json:"has_private_calls"`
2021-12-08 10:23:00 +01:00
// True, if the user can't be linked in forwarded messages due to their privacy settings
HasPrivateForwards bool `json:"has_private_forwards"`
2023-06-04 22:58:07 +02:00
// True, if voice and video notes can't be sent or forwarded to the user
HasRestrictedVoiceAndVideoNoteMessages bool `json:"has_restricted_voice_and_video_note_messages"`
2021-10-22 16:24:12 +02:00
// True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used
NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"`
2023-06-04 22:58:07 +02:00
// A short user bio; may be null for bots
Bio *FormattedText `json:"bio"`
// The list of available options for gifting Telegram Premium to the user
PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"`
2021-10-22 16:24:12 +02:00
// Number of group chats where both the other user and the current user are a member; 0 for the current user
GroupInCommonCount int32 `json:"group_in_common_count"`
2023-06-04 22:58:07 +02:00
// For bots, information about the bot; may be null
BotInfo *BotInfo `json:"bot_info"`
2021-10-22 16:24:12 +02:00
}
func (entity *UserFullInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UserFullInfo
return json.Marshal((*stub)(entity))
}
func (*UserFullInfo) GetClass() string {
return ClassUserFullInfo
}
func (*UserFullInfo) GetType() string {
return TypeUserFullInfo
}
// Represents a list of users
type Users struct {
meta
2023-06-04 22:58:07 +02:00
// Approximate total number of users found
2021-10-22 16:24:12 +02:00
TotalCount int32 `json:"total_count"`
// A list of user identifiers
2021-12-08 10:23:00 +01:00
UserIds []int64 `json:"user_ids"`
2021-10-22 16:24:12 +02:00
}
func (entity *Users) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Users
return json.Marshal((*stub)(entity))
}
func (*Users) GetClass() string {
return ClassUsers
}
func (*Users) GetType() string {
return TypeUsers
}
// Contains information about a chat administrator
type ChatAdministrator struct {
meta
// User identifier of the administrator
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
// Custom title of the administrator
CustomTitle string `json:"custom_title"`
// True, if the user is the owner of the chat
IsOwner bool `json:"is_owner"`
}
func (entity *ChatAdministrator) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatAdministrator
return json.Marshal((*stub)(entity))
}
func (*ChatAdministrator) GetClass() string {
return ClassChatAdministrator
}
func (*ChatAdministrator) GetType() string {
return TypeChatAdministrator
}
// Represents a list of chat administrators
type ChatAdministrators struct {
meta
// A list of chat administrators
Administrators []*ChatAdministrator `json:"administrators"`
}
func (entity *ChatAdministrators) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatAdministrators
return json.Marshal((*stub)(entity))
}
func (*ChatAdministrators) GetClass() string {
return ClassChatAdministrators
}
func (*ChatAdministrators) GetType() string {
return TypeChatAdministrators
}
2021-12-08 10:23:00 +01:00
// The user is the owner of the chat and has all the administrator privileges
2021-10-22 16:24:12 +02:00
type ChatMemberStatusCreator struct {
meta
// A custom title of the owner; 0-16 characters without emojis; 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
IsMember bool `json:"is_member"`
}
func (entity *ChatMemberStatusCreator) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMemberStatusCreator
return json.Marshal((*stub)(entity))
}
func (*ChatMemberStatusCreator) GetClass() string {
return ClassChatMemberStatus
}
func (*ChatMemberStatusCreator) GetType() string {
return TypeChatMemberStatusCreator
}
func (*ChatMemberStatusCreator) ChatMemberStatusType() string {
return TypeChatMemberStatusCreator
}
2021-12-08 10:23:00 +01:00
// 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
2021-10-22 16:24:12 +02:00
type ChatMemberStatusAdministrator struct {
meta
// A custom title of the administrator; 0-16 characters without emojis; 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"`
2023-06-04 22:58:07 +02:00
// Rights of the administrator
Rights *ChatAdministratorRights `json:"rights"`
2021-10-22 16:24:12 +02:00
}
func (entity *ChatMemberStatusAdministrator) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMemberStatusAdministrator
return json.Marshal((*stub)(entity))
}
func (*ChatMemberStatusAdministrator) GetClass() string {
return ClassChatMemberStatus
}
func (*ChatMemberStatusAdministrator) GetType() string {
return TypeChatMemberStatusAdministrator
}
func (*ChatMemberStatusAdministrator) ChatMemberStatusType() string {
return TypeChatMemberStatusAdministrator
}
2021-12-08 10:23:00 +01:00
// The user is a member of the chat, without any additional privileges or restrictions
2021-10-22 16:24:12 +02:00
type ChatMemberStatusMember struct {
meta
}
func (entity *ChatMemberStatusMember) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMemberStatusMember
return json.Marshal((*stub)(entity))
}
func (*ChatMemberStatusMember) GetClass() string {
return ClassChatMemberStatus
}
func (*ChatMemberStatusMember) GetType() string {
return TypeChatMemberStatusMember
}
func (*ChatMemberStatusMember) ChatMemberStatusType() string {
return TypeChatMemberStatusMember
}
// The user is under certain restrictions in the chat. Not supported in basic groups and channels
type ChatMemberStatusRestricted struct {
meta
// True, if the user is a member of the chat
IsMember bool `json:"is_member"`
// Point in time (Unix timestamp) when restrictions will be lifted from the user; 0 if never. If the user is restricted for more than 366 days or for less than 30 seconds from the current time, the user is considered to be restricted forever
RestrictedUntilDate int32 `json:"restricted_until_date"`
// User permissions in the chat
Permissions *ChatPermissions `json:"permissions"`
}
func (entity *ChatMemberStatusRestricted) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMemberStatusRestricted
return json.Marshal((*stub)(entity))
}
func (*ChatMemberStatusRestricted) GetClass() string {
return ClassChatMemberStatus
}
func (*ChatMemberStatusRestricted) GetType() string {
return TypeChatMemberStatusRestricted
}
func (*ChatMemberStatusRestricted) ChatMemberStatusType() string {
return TypeChatMemberStatusRestricted
}
2021-12-08 10:23:00 +01:00
// The user or the chat is not a chat member
2021-10-22 16:24:12 +02:00
type ChatMemberStatusLeft struct {
meta
}
func (entity *ChatMemberStatusLeft) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMemberStatusLeft
return json.Marshal((*stub)(entity))
}
func (*ChatMemberStatusLeft) GetClass() string {
return ClassChatMemberStatus
}
func (*ChatMemberStatusLeft) GetType() string {
return TypeChatMemberStatusLeft
}
func (*ChatMemberStatusLeft) ChatMemberStatusType() string {
return TypeChatMemberStatusLeft
}
2021-12-08 10:23:00 +01:00
// The user or the chat was banned (and hence is not a member of the chat). Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video chat of the chat
2021-10-22 16:24:12 +02:00
type ChatMemberStatusBanned struct {
meta
2021-12-08 10:23:00 +01:00
// Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Always 0 in basic groups
2021-10-22 16:24:12 +02:00
BannedUntilDate int32 `json:"banned_until_date"`
}
func (entity *ChatMemberStatusBanned) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMemberStatusBanned
return json.Marshal((*stub)(entity))
}
func (*ChatMemberStatusBanned) GetClass() string {
return ClassChatMemberStatus
}
func (*ChatMemberStatusBanned) GetType() string {
return TypeChatMemberStatusBanned
}
func (*ChatMemberStatusBanned) ChatMemberStatusType() string {
return TypeChatMemberStatusBanned
}
2021-12-08 10:23:00 +01:00
// Describes a user or a chat as a member of another chat
2021-10-22 16:24:12 +02:00
type ChatMember struct {
meta
2021-12-08 10:23:00 +01:00
// 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"`
2021-10-22 16:24:12 +02:00
// Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown
2021-12-08 10:23:00 +01:00
InviterUserId int64 `json:"inviter_user_id"`
2023-06-04 22:58:07 +02:00
// Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat
2021-10-22 16:24:12 +02:00
JoinedChatDate int32 `json:"joined_chat_date"`
// Status of the member in the chat
Status ChatMemberStatus `json:"status"`
}
func (entity *ChatMember) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMember
return json.Marshal((*stub)(entity))
}
func (*ChatMember) GetClass() string {
return ClassChatMember
}
func (*ChatMember) GetType() string {
return TypeChatMember
}
func (chatMember *ChatMember) UnmarshalJSON(data []byte) error {
var tmp struct {
2021-12-08 10:23:00 +01:00
MemberId json.RawMessage `json:"member_id"`
InviterUserId int64 `json:"inviter_user_id"`
2021-10-22 16:24:12 +02:00
JoinedChatDate int32 `json:"joined_chat_date"`
Status json.RawMessage `json:"status"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chatMember.InviterUserId = tmp.InviterUserId
chatMember.JoinedChatDate = tmp.JoinedChatDate
2021-12-08 10:23:00 +01:00
fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId)
chatMember.MemberId = fieldMemberId
2021-10-22 16:24:12 +02:00
fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status)
chatMember.Status = fieldStatus
return nil
}
// Contains a list of chat members
type ChatMembers struct {
meta
2023-06-04 22:58:07 +02:00
// Approximate total number of chat members found
2021-10-22 16:24:12 +02:00
TotalCount int32 `json:"total_count"`
// A list of chat members
Members []*ChatMember `json:"members"`
}
func (entity *ChatMembers) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMembers
return json.Marshal((*stub)(entity))
}
func (*ChatMembers) GetClass() string {
return ClassChatMembers
}
func (*ChatMembers) GetType() string {
return TypeChatMembers
}
// Returns contacts of the user
type ChatMembersFilterContacts struct {
meta
}
func (entity *ChatMembersFilterContacts) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMembersFilterContacts
return json.Marshal((*stub)(entity))
}
func (*ChatMembersFilterContacts) GetClass() string {
return ClassChatMembersFilter
}
func (*ChatMembersFilterContacts) GetType() string {
return TypeChatMembersFilterContacts
}
func (*ChatMembersFilterContacts) ChatMembersFilterType() string {
return TypeChatMembersFilterContacts
}
// Returns the owner and administrators
type ChatMembersFilterAdministrators struct {
meta
}
func (entity *ChatMembersFilterAdministrators) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMembersFilterAdministrators
return json.Marshal((*stub)(entity))
}
func (*ChatMembersFilterAdministrators) GetClass() string {
return ClassChatMembersFilter
}
func (*ChatMembersFilterAdministrators) GetType() string {
return TypeChatMembersFilterAdministrators
}
func (*ChatMembersFilterAdministrators) ChatMembersFilterType() string {
return TypeChatMembersFilterAdministrators
}
// Returns all chat members, including restricted chat members
type ChatMembersFilterMembers struct {
meta
}
func (entity *ChatMembersFilterMembers) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMembersFilterMembers
return json.Marshal((*stub)(entity))
}
func (*ChatMembersFilterMembers) GetClass() string {
return ClassChatMembersFilter
}
func (*ChatMembersFilterMembers) GetType() string {
return TypeChatMembersFilterMembers
}
func (*ChatMembersFilterMembers) ChatMembersFilterType() string {
return TypeChatMembersFilterMembers
}
// Returns users which can be mentioned in the chat
type ChatMembersFilterMention struct {
meta
// If non-zero, the identifier of the current message thread
MessageThreadId int64 `json:"message_thread_id"`
}
func (entity *ChatMembersFilterMention) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMembersFilterMention
return json.Marshal((*stub)(entity))
}
func (*ChatMembersFilterMention) GetClass() string {
return ClassChatMembersFilter
}
func (*ChatMembersFilterMention) GetType() string {
return TypeChatMembersFilterMention
}
func (*ChatMembersFilterMention) ChatMembersFilterType() string {
return TypeChatMembersFilterMention
}
// Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup
type ChatMembersFilterRestricted struct {
meta
}
func (entity *ChatMembersFilterRestricted) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMembersFilterRestricted
return json.Marshal((*stub)(entity))
}
func (*ChatMembersFilterRestricted) GetClass() string {
return ClassChatMembersFilter
}
func (*ChatMembersFilterRestricted) GetType() string {
return TypeChatMembersFilterRestricted
}
func (*ChatMembersFilterRestricted) ChatMembersFilterType() string {
return TypeChatMembersFilterRestricted
}
// Returns users banned from the chat; can be used only by administrators in a supergroup or in a channel
type ChatMembersFilterBanned struct {
meta
}
func (entity *ChatMembersFilterBanned) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMembersFilterBanned
return json.Marshal((*stub)(entity))
}
func (*ChatMembersFilterBanned) GetClass() string {
return ClassChatMembersFilter
}
func (*ChatMembersFilterBanned) GetType() string {
return TypeChatMembersFilterBanned
}
func (*ChatMembersFilterBanned) ChatMembersFilterType() string {
return TypeChatMembersFilterBanned
}
// Returns bot members of the chat
type ChatMembersFilterBots struct {
meta
}
func (entity *ChatMembersFilterBots) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMembersFilterBots
return json.Marshal((*stub)(entity))
}
func (*ChatMembersFilterBots) GetClass() string {
return ClassChatMembersFilter
}
func (*ChatMembersFilterBots) GetType() string {
return TypeChatMembersFilterBots
}
func (*ChatMembersFilterBots) ChatMembersFilterType() string {
return TypeChatMembersFilterBots
}
// Returns recently active users in reverse chronological order
type SupergroupMembersFilterRecent struct {
meta
}
func (entity *SupergroupMembersFilterRecent) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SupergroupMembersFilterRecent
return json.Marshal((*stub)(entity))
}
func (*SupergroupMembersFilterRecent) GetClass() string {
return ClassSupergroupMembersFilter
}
func (*SupergroupMembersFilterRecent) GetType() string {
return TypeSupergroupMembersFilterRecent
}
func (*SupergroupMembersFilterRecent) SupergroupMembersFilterType() string {
return TypeSupergroupMembersFilterRecent
}
// Returns contacts of the user, which are members of the supergroup or channel
type SupergroupMembersFilterContacts struct {
meta
// Query to search for
Query string `json:"query"`
}
func (entity *SupergroupMembersFilterContacts) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SupergroupMembersFilterContacts
return json.Marshal((*stub)(entity))
}
func (*SupergroupMembersFilterContacts) GetClass() string {
return ClassSupergroupMembersFilter
}
func (*SupergroupMembersFilterContacts) GetType() string {
return TypeSupergroupMembersFilterContacts
}
func (*SupergroupMembersFilterContacts) SupergroupMembersFilterType() string {
return TypeSupergroupMembersFilterContacts
}
// Returns the owner and administrators
type SupergroupMembersFilterAdministrators struct {
meta
}
func (entity *SupergroupMembersFilterAdministrators) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SupergroupMembersFilterAdministrators
return json.Marshal((*stub)(entity))
}
func (*SupergroupMembersFilterAdministrators) GetClass() string {
return ClassSupergroupMembersFilter
}
func (*SupergroupMembersFilterAdministrators) GetType() string {
return TypeSupergroupMembersFilterAdministrators
}
func (*SupergroupMembersFilterAdministrators) SupergroupMembersFilterType() string {
return TypeSupergroupMembersFilterAdministrators
}
// Used to search for supergroup or channel members via a (string) query
type SupergroupMembersFilterSearch struct {
meta
// Query to search for
Query string `json:"query"`
}
func (entity *SupergroupMembersFilterSearch) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SupergroupMembersFilterSearch
return json.Marshal((*stub)(entity))
}
func (*SupergroupMembersFilterSearch) GetClass() string {
return ClassSupergroupMembersFilter
}
func (*SupergroupMembersFilterSearch) GetType() string {
return TypeSupergroupMembersFilterSearch
}
func (*SupergroupMembersFilterSearch) SupergroupMembersFilterType() string {
return TypeSupergroupMembersFilterSearch
}
// Returns restricted supergroup members; can be used only by administrators
type SupergroupMembersFilterRestricted struct {
meta
// Query to search for
Query string `json:"query"`
}
func (entity *SupergroupMembersFilterRestricted) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SupergroupMembersFilterRestricted
return json.Marshal((*stub)(entity))
}
func (*SupergroupMembersFilterRestricted) GetClass() string {
return ClassSupergroupMembersFilter
}
func (*SupergroupMembersFilterRestricted) GetType() string {
return TypeSupergroupMembersFilterRestricted
}
func (*SupergroupMembersFilterRestricted) SupergroupMembersFilterType() string {
return TypeSupergroupMembersFilterRestricted
}
// Returns users banned from the supergroup or channel; can be used only by administrators
type SupergroupMembersFilterBanned struct {
meta
// Query to search for
Query string `json:"query"`
}
func (entity *SupergroupMembersFilterBanned) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SupergroupMembersFilterBanned
return json.Marshal((*stub)(entity))
}
func (*SupergroupMembersFilterBanned) GetClass() string {
return ClassSupergroupMembersFilter
}
func (*SupergroupMembersFilterBanned) GetType() string {
return TypeSupergroupMembersFilterBanned
}
func (*SupergroupMembersFilterBanned) SupergroupMembersFilterType() string {
return TypeSupergroupMembersFilterBanned
}
// Returns users which can be mentioned in the supergroup
type SupergroupMembersFilterMention struct {
meta
// Query to search for
Query string `json:"query"`
// If non-zero, the identifier of the current message thread
MessageThreadId int64 `json:"message_thread_id"`
}
func (entity *SupergroupMembersFilterMention) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SupergroupMembersFilterMention
return json.Marshal((*stub)(entity))
}
func (*SupergroupMembersFilterMention) GetClass() string {
return ClassSupergroupMembersFilter
}
func (*SupergroupMembersFilterMention) GetType() string {
return TypeSupergroupMembersFilterMention
}
func (*SupergroupMembersFilterMention) SupergroupMembersFilterType() string {
return TypeSupergroupMembersFilterMention
}
// Returns bot members of the supergroup or channel
type SupergroupMembersFilterBots struct {
meta
}
func (entity *SupergroupMembersFilterBots) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SupergroupMembersFilterBots
return json.Marshal((*stub)(entity))
}
func (*SupergroupMembersFilterBots) GetClass() string {
return ClassSupergroupMembersFilter
}
func (*SupergroupMembersFilterBots) GetType() string {
return TypeSupergroupMembersFilterBots
}
func (*SupergroupMembersFilterBots) SupergroupMembersFilterType() string {
return TypeSupergroupMembersFilterBots
}
2021-12-08 10:23:00 +01:00
// Contains a chat invite link
type ChatInviteLink struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Chat invite link
InviteLink string `json:"invite_link"`
// Name of the link
Name string `json:"name"`
// User identifier of an administrator created the link
CreatorUserId int64 `json:"creator_user_id"`
// Point in time (Unix timestamp) when the link was created
Date int32 `json:"date"`
// Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown
EditDate int32 `json:"edit_date"`
// Point in time (Unix timestamp) when the link will expire; 0 if never
2022-04-18 22:45:01 +02:00
ExpirationDate int32 `json:"expiration_date"`
2021-12-08 10:23:00 +01:00
// The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval
MemberLimit int32 `json:"member_limit"`
// Number of chat members, which joined the chat using the link
2021-10-22 16:24:12 +02:00
MemberCount int32 `json:"member_count"`
2021-12-08 10:23:00 +01:00
// Number of pending join requests created using this link
PendingJoinRequestCount int32 `json:"pending_join_request_count"`
// True, if the link only creates join request. If true, total number of joining members will be unlimited
CreatesJoinRequest bool `json:"creates_join_request"`
2022-04-18 22:45:01 +02:00
// True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time
2021-12-08 10:23:00 +01:00
IsPrimary bool `json:"is_primary"`
// True, if the link was revoked
IsRevoked bool `json:"is_revoked"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatInviteLink) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatInviteLink
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLink) GetClass() string {
return ClassChatInviteLink
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLink) GetType() string {
return TypeChatInviteLink
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains a list of chat invite links
type ChatInviteLinks struct {
meta
2023-06-04 22:58:07 +02:00
// Approximate total number of chat invite links found
2021-12-08 10:23:00 +01:00
TotalCount int32 `json:"total_count"`
// List of invite links
InviteLinks []*ChatInviteLink `json:"invite_links"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *ChatInviteLinks) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub ChatInviteLinks
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinks) GetClass() string {
return ClassChatInviteLinks
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinks) GetType() string {
return TypeChatInviteLinks
}
// Describes a chat administrator with a number of active and revoked chat invite links
type ChatInviteLinkCount struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Administrator's user identifier
UserId int64 `json:"user_id"`
// Number of active invite links
InviteLinkCount int32 `json:"invite_link_count"`
// Number of revoked invite links
RevokedInviteLinkCount int32 `json:"revoked_invite_link_count"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatInviteLinkCount) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatInviteLinkCount
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinkCount) GetClass() string {
return ClassChatInviteLinkCount
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinkCount) GetType() string {
return TypeChatInviteLinkCount
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains a list of chat invite link counts
type ChatInviteLinkCounts struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of invite link counts
InviteLinkCounts []*ChatInviteLinkCount `json:"invite_link_counts"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatInviteLinkCounts) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatInviteLinkCounts
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinkCounts) GetClass() string {
return ClassChatInviteLinkCounts
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinkCounts) GetType() string {
return TypeChatInviteLinkCounts
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// Describes a chat member joined a chat via an invite link
2021-12-08 10:23:00 +01:00
type ChatInviteLinkMember struct {
meta
// User identifier
UserId int64 `json:"user_id"`
// Point in time (Unix timestamp) when the user joined the chat
JoinedChatDate int32 `json:"joined_chat_date"`
// User identifier of the chat administrator, approved user join request
ApproverUserId int64 `json:"approver_user_id"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *ChatInviteLinkMember) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub ChatInviteLinkMember
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinkMember) GetClass() string {
return ClassChatInviteLinkMember
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinkMember) GetType() string {
return TypeChatInviteLinkMember
}
2022-04-18 22:45:01 +02:00
// Contains a list of chat members joined a chat via an invite link
2021-12-08 10:23:00 +01:00
type ChatInviteLinkMembers struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Approximate total number of chat members found
2021-12-08 10:23:00 +01:00
TotalCount int32 `json:"total_count"`
2022-04-18 22:45:01 +02:00
// List of chat members, joined a chat via an invite link
2021-12-08 10:23:00 +01:00
Members []*ChatInviteLinkMember `json:"members"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatInviteLinkMembers) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatInviteLinkMembers
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinkMembers) GetClass() string {
return ClassChatInviteLinkMembers
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinkMembers) GetType() string {
return TypeChatInviteLinkMembers
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about a chat invite link
type ChatInviteLinkInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Chat identifier of the invite link; 0 if the user has no access to the chat before joining
ChatId int64 `json:"chat_id"`
// If non-zero, the amount of time for which read access to the chat will remain available, in seconds
AccessibleFor int32 `json:"accessible_for"`
// Type of the chat
Type ChatType `json:"type"`
// Title of the chat
Title string `json:"title"`
// Chat photo; may be null
Photo *ChatPhotoInfo `json:"photo"`
// Chat description
Description string `json:"description"`
// Number of members in the chat
MemberCount int32 `json:"member_count"`
// User identifiers of some chat members that may be known to the current user
MemberUserIds []int64 `json:"member_user_ids"`
// True, if the link only creates join request
CreatesJoinRequest bool `json:"creates_join_request"`
// True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup
IsPublic bool `json:"is_public"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatInviteLinkInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatInviteLinkInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinkInfo) GetClass() string {
return ClassChatInviteLinkInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatInviteLinkInfo) GetType() string {
return TypeChatInviteLinkInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error {
var tmp struct {
ChatId int64 `json:"chat_id"`
AccessibleFor int32 `json:"accessible_for"`
Type json.RawMessage `json:"type"`
Title string `json:"title"`
Photo *ChatPhotoInfo `json:"photo"`
Description string `json:"description"`
MemberCount int32 `json:"member_count"`
MemberUserIds []int64 `json:"member_user_ids"`
CreatesJoinRequest bool `json:"creates_join_request"`
IsPublic bool `json:"is_public"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chatInviteLinkInfo.ChatId = tmp.ChatId
chatInviteLinkInfo.AccessibleFor = tmp.AccessibleFor
chatInviteLinkInfo.Title = tmp.Title
chatInviteLinkInfo.Photo = tmp.Photo
chatInviteLinkInfo.Description = tmp.Description
chatInviteLinkInfo.MemberCount = tmp.MemberCount
chatInviteLinkInfo.MemberUserIds = tmp.MemberUserIds
chatInviteLinkInfo.CreatesJoinRequest = tmp.CreatesJoinRequest
chatInviteLinkInfo.IsPublic = tmp.IsPublic
fieldType, _ := UnmarshalChatType(tmp.Type)
chatInviteLinkInfo.Type = fieldType
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Describes a user that sent a join request and waits for administrator approval
type ChatJoinRequest struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// User identifier
UserId int64 `json:"user_id"`
// Point in time (Unix timestamp) when the user sent the join request
Date int32 `json:"date"`
// A short bio of the user
Bio string `json:"bio"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatJoinRequest) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatJoinRequest
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatJoinRequest) GetClass() string {
return ClassChatJoinRequest
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatJoinRequest) GetType() string {
return TypeChatJoinRequest
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// Contains a list of requests to join a chat
2021-12-08 10:23:00 +01:00
type ChatJoinRequests struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Approximate total number of requests found
2021-12-08 10:23:00 +01:00
TotalCount int32 `json:"total_count"`
// List of the requests
Requests []*ChatJoinRequest `json:"requests"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatJoinRequests) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatJoinRequests
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatJoinRequests) GetClass() string {
return ClassChatJoinRequests
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatJoinRequests) GetType() string {
return TypeChatJoinRequests
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// Contains information about pending join requests for a chat
2021-12-08 10:23:00 +01:00
type ChatJoinRequestsInfo struct {
meta
// Total number of pending join requests
TotalCount int32 `json:"total_count"`
2022-04-18 22:45:01 +02:00
// Identifiers of at most 3 users sent the newest pending join requests
2021-12-08 10:23:00 +01:00
UserIds []int64 `json:"user_ids"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatJoinRequestsInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatJoinRequestsInfo
return json.Marshal((*stub)(entity))
}
func (*ChatJoinRequestsInfo) GetClass() string {
return ClassChatJoinRequestsInfo
}
func (*ChatJoinRequestsInfo) GetType() string {
return TypeChatJoinRequestsInfo
}
// Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)
type BasicGroup struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Group identifier
Id int64 `json:"id"`
// Number of members in the group
MemberCount int32 `json:"member_count"`
// Status of the current user in the group
Status ChatMemberStatus `json:"status"`
// True, if the group is active
IsActive bool `json:"is_active"`
// Identifier of the supergroup to which this group was upgraded; 0 if none
UpgradedToSupergroupId int64 `json:"upgraded_to_supergroup_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *BasicGroup) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub BasicGroup
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*BasicGroup) GetClass() string {
return ClassBasicGroup
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*BasicGroup) GetType() string {
return TypeBasicGroup
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (basicGroup *BasicGroup) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Id int64 `json:"id"`
MemberCount int32 `json:"member_count"`
Status json.RawMessage `json:"status"`
IsActive bool `json:"is_active"`
UpgradedToSupergroupId int64 `json:"upgraded_to_supergroup_id"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
basicGroup.Id = tmp.Id
basicGroup.MemberCount = tmp.MemberCount
basicGroup.IsActive = tmp.IsActive
basicGroup.UpgradedToSupergroupId = tmp.UpgradedToSupergroupId
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status)
basicGroup.Status = fieldStatus
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// Contains full information about a basic group
type BasicGroupFullInfo struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
2021-12-08 10:23:00 +01:00
Photo *ChatPhoto `json:"photo"`
// Group description. Updated only after the basic group is opened
Description string `json:"description"`
// User identifier of the creator of the group; 0 if unknown
CreatorUserId int64 `json:"creator_user_id"`
// Group members
Members []*ChatMember `json:"members"`
2023-06-04 22:58:07 +02:00
// True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup
CanHideMembers bool `json:"can_hide_members"`
// True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup
CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"`
2021-12-08 10:23:00 +01:00
// Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened
InviteLink *ChatInviteLink `json:"invite_link"`
// List of commands of bots in the group
BotCommands []*BotCommands `json:"bot_commands"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *BasicGroupFullInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub BasicGroupFullInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*BasicGroupFullInfo) GetClass() string {
return ClassBasicGroupFullInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*BasicGroupFullInfo) GetType() string {
return TypeBasicGroupFullInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup: only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos. Unlike supergroups, channels can have an unlimited number of subscribers
type Supergroup struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Supergroup or channel identifier
Id int64 `json:"id"`
2023-06-04 22:58:07 +02:00
// Usernames of the supergroup or channel; may be null
Usernames *Usernames `json:"usernames"`
2021-12-08 10:23:00 +01:00
// 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"`
2023-06-04 22:58:07 +02:00
// Status of the current user in the supergroup or channel; custom title will always be empty
2021-12-08 10:23:00 +01:00
Status ChatMemberStatus `json:"status"`
2022-04-18 22:45:01 +02:00
// 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 searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules
2021-12-08 10:23:00 +01:00
MemberCount int32 `json:"member_count"`
// True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel
HasLinkedChat bool `json:"has_linked_chat"`
// True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup
HasLocation bool `json:"has_location"`
// True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels
SignMessages bool `json:"sign_messages"`
2023-06-04 22:58:07 +02:00
// True, if users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups
JoinToSendMessages bool `json:"join_to_send_messages"`
// True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat
JoinByRequest bool `json:"join_by_request"`
2021-12-08 10:23:00 +01:00
// True, if the slow mode is enabled in the supergroup
IsSlowModeEnabled bool `json:"is_slow_mode_enabled"`
// True, if the supergroup is a channel
IsChannel bool `json:"is_channel"`
2022-04-18 22:45:01 +02:00
// True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members
2021-12-08 10:23:00 +01:00
IsBroadcastGroup bool `json:"is_broadcast_group"`
2023-06-04 22:58:07 +02:00
// True, if the supergroup must be shown as a forum by default
IsForum bool `json:"is_forum"`
2021-12-08 10:23:00 +01:00
// True, if the supergroup or channel is verified
IsVerified bool `json:"is_verified"`
// If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted
RestrictionReason string `json:"restriction_reason"`
// True, if many users reported this supergroup or channel as a scam
IsScam bool `json:"is_scam"`
// True, if many users reported this supergroup or channel as a fake account
IsFake bool `json:"is_fake"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Supergroup) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Supergroup
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Supergroup) GetClass() string {
return ClassSupergroup
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Supergroup) GetType() string {
return TypeSupergroup
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (supergroup *Supergroup) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2023-06-04 22:58:07 +02:00
Id int64 `json:"id"`
Usernames *Usernames `json:"usernames"`
Date int32 `json:"date"`
Status json.RawMessage `json:"status"`
MemberCount int32 `json:"member_count"`
HasLinkedChat bool `json:"has_linked_chat"`
HasLocation bool `json:"has_location"`
SignMessages bool `json:"sign_messages"`
JoinToSendMessages bool `json:"join_to_send_messages"`
JoinByRequest bool `json:"join_by_request"`
IsSlowModeEnabled bool `json:"is_slow_mode_enabled"`
IsChannel bool `json:"is_channel"`
IsBroadcastGroup bool `json:"is_broadcast_group"`
IsForum bool `json:"is_forum"`
IsVerified bool `json:"is_verified"`
RestrictionReason string `json:"restriction_reason"`
IsScam bool `json:"is_scam"`
IsFake bool `json:"is_fake"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
supergroup.Id = tmp.Id
2023-06-04 22:58:07 +02:00
supergroup.Usernames = tmp.Usernames
2021-12-08 10:23:00 +01:00
supergroup.Date = tmp.Date
supergroup.MemberCount = tmp.MemberCount
supergroup.HasLinkedChat = tmp.HasLinkedChat
supergroup.HasLocation = tmp.HasLocation
supergroup.SignMessages = tmp.SignMessages
2023-06-04 22:58:07 +02:00
supergroup.JoinToSendMessages = tmp.JoinToSendMessages
supergroup.JoinByRequest = tmp.JoinByRequest
2021-12-08 10:23:00 +01:00
supergroup.IsSlowModeEnabled = tmp.IsSlowModeEnabled
supergroup.IsChannel = tmp.IsChannel
supergroup.IsBroadcastGroup = tmp.IsBroadcastGroup
2023-06-04 22:58:07 +02:00
supergroup.IsForum = tmp.IsForum
2021-12-08 10:23:00 +01:00
supergroup.IsVerified = tmp.IsVerified
supergroup.RestrictionReason = tmp.RestrictionReason
supergroup.IsScam = tmp.IsScam
supergroup.IsFake = tmp.IsFake
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status)
supergroup.Status = fieldStatus
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// Contains full information about a supergroup or channel
type SupergroupFullInfo struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
2021-12-08 10:23:00 +01:00
Photo *ChatPhoto `json:"photo"`
// Supergroup or channel description
Description string `json:"description"`
// Number of members in the supergroup or channel; 0 if unknown
MemberCount int32 `json:"member_count"`
// Number of privileged users in the supergroup or channel; 0 if unknown
AdministratorCount int32 `json:"administrator_count"`
// Number of restricted users in the supergroup; 0 if unknown
RestrictedCount int32 `json:"restricted_count"`
// Number of users banned from chat; 0 if unknown
BannedCount int32 `json:"banned_count"`
// Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown
LinkedChatId int64 `json:"linked_chat_id"`
// Delay between consecutive sent messages for non-administrator supergroup members, in seconds
SlowModeDelay int32 `json:"slow_mode_delay"`
// Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero
SlowModeDelayExpiresIn float64 `json:"slow_mode_delay_expires_in"`
2023-06-04 22:58:07 +02:00
// True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers
2021-12-08 10:23:00 +01:00
CanGetMembers bool `json:"can_get_members"`
2023-06-04 22:58:07 +02:00
// True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers
HasHiddenMembers bool `json:"has_hidden_members"`
// True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators
CanHideMembers bool `json:"can_hide_members"`
2021-12-08 10:23:00 +01:00
// True, if the chat username can be changed
CanSetUsername bool `json:"can_set_username"`
// True, if the supergroup sticker set can be changed
CanSetStickerSet bool `json:"can_set_sticker_set"`
// True, if the supergroup location can be changed
CanSetLocation bool `json:"can_set_location"`
// True, if the supergroup or channel statistics are available
CanGetStatistics bool `json:"can_get_statistics"`
2023-06-04 22:58:07 +02:00
// True, if aggressive anti-spam checks can be enabled or disabled in the supergroup
CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"`
// True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators
2021-12-08 10:23:00 +01:00
IsAllHistoryAvailable bool `json:"is_all_history_available"`
2023-06-04 22:58:07 +02:00
// True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators
HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"`
2021-12-08 10:23:00 +01:00
// Identifier of the supergroup sticker set; 0 if none
StickerSetId JsonInt64 `json:"sticker_set_id"`
// Location to which the supergroup is connected; may be null
Location *ChatLocation `json:"location"`
2023-06-04 22:58:07 +02:00
// Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only
2021-12-08 10:23:00 +01:00
InviteLink *ChatInviteLink `json:"invite_link"`
// List of commands of bots in the group
BotCommands []*BotCommands `json:"bot_commands"`
// Identifier of the basic group from which supergroup was upgraded; 0 if none
UpgradedFromBasicGroupId int64 `json:"upgraded_from_basic_group_id"`
// Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none
UpgradedFromMaxMessageId int64 `json:"upgraded_from_max_message_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *SupergroupFullInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SupergroupFullInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SupergroupFullInfo) GetClass() string {
return ClassSupergroupFullInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SupergroupFullInfo) GetType() string {
return TypeSupergroupFullInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The secret chat is not yet created; waiting for the other user to get online
type SecretChatStatePending struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SecretChatStatePending) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SecretChatStatePending
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SecretChatStatePending) GetClass() string {
return ClassSecretChatState
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SecretChatStatePending) GetType() string {
return TypeSecretChatStatePending
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SecretChatStatePending) SecretChatStateType() string {
return TypeSecretChatStatePending
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The secret chat is ready to use
type SecretChatStateReady struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SecretChatStateReady) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SecretChatStateReady
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SecretChatStateReady) GetClass() string {
return ClassSecretChatState
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SecretChatStateReady) GetType() string {
return TypeSecretChatStateReady
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SecretChatStateReady) SecretChatStateType() string {
return TypeSecretChatStateReady
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The secret chat is closed
type SecretChatStateClosed struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SecretChatStateClosed) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SecretChatStateClosed
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SecretChatStateClosed) GetClass() string {
return ClassSecretChatState
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SecretChatStateClosed) GetType() string {
return TypeSecretChatStateClosed
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SecretChatStateClosed) SecretChatStateType() string {
return TypeSecretChatStateClosed
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Represents a secret chat
type SecretChat struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Secret chat identifier
Id int32 `json:"id"`
// Identifier of the chat partner
UserId int64 `json:"user_id"`
// State of the secret chat
State SecretChatState `json:"state"`
// True, if the chat was created by the current user; otherwise false
IsOutbound bool `json:"is_outbound"`
// Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers
KeyHash []byte `json:"key_hash"`
2023-06-04 22:58:07 +02:00
// Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101, files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144
2021-12-08 10:23:00 +01:00
Layer int32 `json:"layer"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *SecretChat) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SecretChat
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SecretChat) GetClass() string {
return ClassSecretChat
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SecretChat) GetType() string {
return TypeSecretChat
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (secretChat *SecretChat) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Id int32 `json:"id"`
UserId int64 `json:"user_id"`
State json.RawMessage `json:"state"`
IsOutbound bool `json:"is_outbound"`
KeyHash []byte `json:"key_hash"`
Layer int32 `json:"layer"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
secretChat.Id = tmp.Id
secretChat.UserId = tmp.UserId
secretChat.IsOutbound = tmp.IsOutbound
secretChat.KeyHash = tmp.KeyHash
secretChat.Layer = tmp.Layer
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldState, _ := UnmarshalSecretChatState(tmp.State)
secretChat.State = fieldState
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// The message was sent by a known user
type MessageSenderUser struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the user that sent the message
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageSenderUser) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageSenderUser
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageSenderUser) GetClass() string {
return ClassMessageSender
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSenderUser) GetType() string {
return TypeMessageSenderUser
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSenderUser) MessageSenderType() string {
return TypeMessageSenderUser
}
// The message was sent on behalf of a chat
type MessageSenderChat struct {
meta
// Identifier of the chat that sent the message
ChatId int64 `json:"chat_id"`
}
func (entity *MessageSenderChat) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageSenderChat
return json.Marshal((*stub)(entity))
}
func (*MessageSenderChat) GetClass() string {
return ClassMessageSender
}
func (*MessageSenderChat) GetType() string {
return TypeMessageSenderChat
}
func (*MessageSenderChat) MessageSenderType() string {
return TypeMessageSenderChat
}
// Represents a list of message senders
type MessageSenders struct {
meta
2023-06-04 22:58:07 +02:00
// Approximate total number of messages senders found
2021-12-08 10:23:00 +01:00
TotalCount int32 `json:"total_count"`
// List of message senders
Senders []MessageSender `json:"senders"`
}
func (entity *MessageSenders) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageSenders
return json.Marshal((*stub)(entity))
}
func (*MessageSenders) GetClass() string {
return ClassMessageSenders
}
func (*MessageSenders) GetType() string {
return TypeMessageSenders
}
func (messageSenders *MessageSenders) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
TotalCount int32 `json:"total_count"`
Senders []json.RawMessage `json:"senders"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
messageSenders.TotalCount = tmp.TotalCount
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldSenders, _ := UnmarshalListOfMessageSender(tmp.Senders)
messageSenders.Senders = fieldSenders
2021-10-22 16:24:12 +02:00
return nil
}
2023-06-04 22:58:07 +02:00
// Represents a message sender, which can be used to send messages in a chat
type ChatMessageSender struct {
meta
// Available message senders
Sender MessageSender `json:"sender"`
// True, if Telegram Premium is needed to use the message sender
NeedsPremium bool `json:"needs_premium"`
}
func (entity *ChatMessageSender) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMessageSender
return json.Marshal((*stub)(entity))
}
func (*ChatMessageSender) GetClass() string {
return ClassChatMessageSender
}
func (*ChatMessageSender) GetType() string {
return TypeChatMessageSender
}
func (chatMessageSender *ChatMessageSender) UnmarshalJSON(data []byte) error {
var tmp struct {
Sender json.RawMessage `json:"sender"`
NeedsPremium bool `json:"needs_premium"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chatMessageSender.NeedsPremium = tmp.NeedsPremium
fieldSender, _ := UnmarshalMessageSender(tmp.Sender)
chatMessageSender.Sender = fieldSender
return nil
}
// Represents a list of message senders, which can be used to send messages in a chat
type ChatMessageSenders struct {
meta
// List of available message senders
Senders []*ChatMessageSender `json:"senders"`
}
func (entity *ChatMessageSenders) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatMessageSenders
return json.Marshal((*stub)(entity))
}
func (*ChatMessageSenders) GetClass() string {
return ClassChatMessageSenders
}
func (*ChatMessageSenders) GetType() string {
return TypeChatMessageSenders
}
2021-12-08 10:23:00 +01:00
// The message was originally sent by a known user
type MessageForwardOriginUser struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the user that originally sent the message
SenderUserId int64 `json:"sender_user_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageForwardOriginUser) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageForwardOriginUser
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginUser) GetClass() string {
return ClassMessageForwardOrigin
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginUser) GetType() string {
return TypeMessageForwardOriginUser
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginUser) MessageForwardOriginType() string {
return TypeMessageForwardOriginUser
}
2022-04-18 22:45:01 +02:00
// The message was originally sent on behalf of a chat
2021-12-08 10:23:00 +01:00
type MessageForwardOriginChat struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the chat that originally sent the message
SenderChatId int64 `json:"sender_chat_id"`
2022-04-18 22:45:01 +02:00
// For messages originally sent by an anonymous chat administrator, original message author signature
2021-12-08 10:23:00 +01:00
AuthorSignature string `json:"author_signature"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageForwardOriginChat) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageForwardOriginChat
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginChat) GetClass() string {
return ClassMessageForwardOrigin
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginChat) GetType() string {
return TypeMessageForwardOriginChat
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginChat) MessageForwardOriginType() string {
return TypeMessageForwardOriginChat
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The message was originally sent by a user, which is hidden by their privacy settings
type MessageForwardOriginHiddenUser struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Name of the sender
SenderName string `json:"sender_name"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageForwardOriginHiddenUser) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageForwardOriginHiddenUser
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginHiddenUser) GetClass() string {
return ClassMessageForwardOrigin
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginHiddenUser) GetType() string {
return TypeMessageForwardOriginHiddenUser
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginHiddenUser) MessageForwardOriginType() string {
return TypeMessageForwardOriginHiddenUser
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The message was originally a post in a channel
type MessageForwardOriginChannel struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the chat from which the message was originally forwarded
2021-10-22 16:24:12 +02:00
ChatId int64 `json:"chat_id"`
2021-12-08 10:23:00 +01:00
// Message identifier of the original message
MessageId int64 `json:"message_id"`
// Original post author signature
2021-10-22 16:24:12 +02:00
AuthorSignature string `json:"author_signature"`
}
2021-12-08 10:23:00 +01:00
func (entity *MessageForwardOriginChannel) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageForwardOriginChannel
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginChannel) GetClass() string {
return ClassMessageForwardOrigin
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginChannel) GetType() string {
return TypeMessageForwardOriginChannel
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginChannel) MessageForwardOriginType() string {
return TypeMessageForwardOriginChannel
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
// The message was imported from an exported message history
type MessageForwardOriginMessageImport struct {
meta
// Name of the sender
SenderName string `json:"sender_name"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *MessageForwardOriginMessageImport) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub MessageForwardOriginMessageImport
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginMessageImport) GetClass() string {
return ClassMessageForwardOrigin
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginMessageImport) GetType() string {
return TypeMessageForwardOriginMessageImport
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*MessageForwardOriginMessageImport) MessageForwardOriginType() string {
return TypeMessageForwardOriginMessageImport
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A reaction with an emoji
type ReactionTypeEmoji struct {
meta
// Text representation of the reaction
Emoji string `json:"emoji"`
}
func (entity *ReactionTypeEmoji) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ReactionTypeEmoji
return json.Marshal((*stub)(entity))
}
func (*ReactionTypeEmoji) GetClass() string {
return ClassReactionType
}
func (*ReactionTypeEmoji) GetType() string {
return TypeReactionTypeEmoji
}
func (*ReactionTypeEmoji) ReactionTypeType() string {
return TypeReactionTypeEmoji
}
// A reaction with a custom emoji
type ReactionTypeCustomEmoji struct {
meta
// Unique identifier of the custom emoji
CustomEmojiId JsonInt64 `json:"custom_emoji_id"`
}
func (entity *ReactionTypeCustomEmoji) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ReactionTypeCustomEmoji
return json.Marshal((*stub)(entity))
}
func (*ReactionTypeCustomEmoji) GetClass() string {
return ClassReactionType
}
func (*ReactionTypeCustomEmoji) GetType() string {
return TypeReactionTypeCustomEmoji
}
func (*ReactionTypeCustomEmoji) ReactionTypeType() string {
return TypeReactionTypeCustomEmoji
}
2021-12-08 10:23:00 +01:00
// Contains information about a forwarded message
type MessageForwardInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Origin of a forwarded message
Origin MessageForwardOrigin `json:"origin"`
// Point in time (Unix timestamp) when the message was originally sent
Date int32 `json:"date"`
// The type of a public service announcement for the forwarded message
PublicServiceAnnouncementType string `json:"public_service_announcement_type"`
// For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown
FromChatId int64 `json:"from_chat_id"`
// For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown
FromMessageId int64 `json:"from_message_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageForwardInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageForwardInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardInfo) GetClass() string {
return ClassMessageForwardInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageForwardInfo) GetType() string {
return TypeMessageForwardInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (messageForwardInfo *MessageForwardInfo) UnmarshalJSON(data []byte) error {
var tmp struct {
Origin json.RawMessage `json:"origin"`
Date int32 `json:"date"`
PublicServiceAnnouncementType string `json:"public_service_announcement_type"`
FromChatId int64 `json:"from_chat_id"`
FromMessageId int64 `json:"from_message_id"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
messageForwardInfo.Date = tmp.Date
messageForwardInfo.PublicServiceAnnouncementType = tmp.PublicServiceAnnouncementType
messageForwardInfo.FromChatId = tmp.FromChatId
messageForwardInfo.FromMessageId = tmp.FromMessageId
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldOrigin, _ := UnmarshalMessageForwardOrigin(tmp.Origin)
messageForwardInfo.Origin = fieldOrigin
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about replies to a message
type MessageReplyInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Number of times the message was directly or indirectly replied
ReplyCount int32 `json:"reply_count"`
2022-04-18 22:45:01 +02:00
// Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible: only their photo and name will be available
2021-12-08 10:23:00 +01:00
RecentReplierIds []MessageSender `json:"recent_replier_ids"`
// Identifier of the last read incoming reply to the message
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
// Identifier of the last read outgoing reply to the message
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
// Identifier of the last reply to the message
LastMessageId int64 `json:"last_message_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageReplyInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageReplyInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageReplyInfo) GetClass() string {
return ClassMessageReplyInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageReplyInfo) GetType() string {
return TypeMessageReplyInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (messageReplyInfo *MessageReplyInfo) UnmarshalJSON(data []byte) error {
var tmp struct {
ReplyCount int32 `json:"reply_count"`
RecentReplierIds []json.RawMessage `json:"recent_replier_ids"`
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
LastMessageId int64 `json:"last_message_id"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
messageReplyInfo.ReplyCount = tmp.ReplyCount
messageReplyInfo.LastReadInboxMessageId = tmp.LastReadInboxMessageId
messageReplyInfo.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId
messageReplyInfo.LastMessageId = tmp.LastMessageId
fieldRecentReplierIds, _ := UnmarshalListOfMessageSender(tmp.RecentReplierIds)
messageReplyInfo.RecentReplierIds = fieldRecentReplierIds
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains information about a reaction to a message
type MessageReaction struct {
meta
// Type of the reaction
Type ReactionType `json:"type"`
// Number of times the reaction was added
TotalCount int32 `json:"total_count"`
// True, if the reaction is chosen by the current user
IsChosen bool `json:"is_chosen"`
// Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats
RecentSenderIds []MessageSender `json:"recent_sender_ids"`
}
func (entity *MessageReaction) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageReaction
return json.Marshal((*stub)(entity))
}
func (*MessageReaction) GetClass() string {
return ClassMessageReaction
}
func (*MessageReaction) GetType() string {
return TypeMessageReaction
}
func (messageReaction *MessageReaction) UnmarshalJSON(data []byte) error {
var tmp struct {
Type json.RawMessage `json:"type"`
TotalCount int32 `json:"total_count"`
IsChosen bool `json:"is_chosen"`
RecentSenderIds []json.RawMessage `json:"recent_sender_ids"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
messageReaction.TotalCount = tmp.TotalCount
messageReaction.IsChosen = tmp.IsChosen
fieldType, _ := UnmarshalReactionType(tmp.Type)
messageReaction.Type = fieldType
fieldRecentSenderIds, _ := UnmarshalListOfMessageSender(tmp.RecentSenderIds)
messageReaction.RecentSenderIds = fieldRecentSenderIds
return nil
}
2021-12-08 10:23:00 +01:00
// Contains information about interactions with a message
type MessageInteractionInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Number of times the message was viewed
ViewCount int32 `json:"view_count"`
// Number of times the message was forwarded
ForwardCount int32 `json:"forward_count"`
// Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself
ReplyInfo *MessageReplyInfo `json:"reply_info"`
2023-06-04 22:58:07 +02:00
// The list of reactions added to the message
Reactions []*MessageReaction `json:"reactions"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageInteractionInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageInteractionInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageInteractionInfo) GetClass() string {
return ClassMessageInteractionInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageInteractionInfo) GetType() string {
return TypeMessageInteractionInfo
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains information about an unread reaction to a message
type UnreadReaction struct {
meta
// Type of the reaction
Type ReactionType `json:"type"`
// Identifier of the sender, added the reaction
SenderId MessageSender `json:"sender_id"`
// True, if the reaction was added with a big animation
IsBig bool `json:"is_big"`
}
func (entity *UnreadReaction) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UnreadReaction
return json.Marshal((*stub)(entity))
}
func (*UnreadReaction) GetClass() string {
return ClassUnreadReaction
}
func (*UnreadReaction) GetType() string {
return TypeUnreadReaction
}
func (unreadReaction *UnreadReaction) UnmarshalJSON(data []byte) error {
var tmp struct {
Type json.RawMessage `json:"type"`
SenderId json.RawMessage `json:"sender_id"`
IsBig bool `json:"is_big"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
unreadReaction.IsBig = tmp.IsBig
fieldType, _ := UnmarshalReactionType(tmp.Type)
unreadReaction.Type = fieldType
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
unreadReaction.SenderId = fieldSenderId
return nil
}
2021-12-08 10:23:00 +01:00
// The message is being sent now, but has not yet been delivered to the server
type MessageSendingStatePending struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *MessageSendingStatePending) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageSendingStatePending
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageSendingStatePending) GetClass() string {
return ClassMessageSendingState
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSendingStatePending) GetType() string {
return TypeMessageSendingStatePending
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSendingStatePending) MessageSendingStateType() string {
return TypeMessageSendingStatePending
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The message failed to be sent
type MessageSendingStateFailed struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// An error code; 0 if unknown
ErrorCode int32 `json:"error_code"`
// Error message
ErrorMessage string `json:"error_message"`
// True, if the message can be re-sent
CanRetry bool `json:"can_retry"`
// True, if the message can be re-sent only on behalf of a different sender
NeedAnotherSender bool `json:"need_another_sender"`
// Time left before the message can be re-sent, in seconds. No update is sent when this field changes
RetryAfter float64 `json:"retry_after"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageSendingStateFailed) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageSendingStateFailed
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageSendingStateFailed) GetClass() string {
return ClassMessageSendingState
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSendingStateFailed) GetType() string {
return TypeMessageSendingStateFailed
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSendingStateFailed) MessageSendingStateType() string {
return TypeMessageSendingStateFailed
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Describes a message
type Message struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Message identifier; unique for the chat to which the message belongs
Id int64 `json:"id"`
// Identifier of the sender of the message
SenderId MessageSender `json:"sender_id"`
// Chat identifier
ChatId int64 `json:"chat_id"`
// The sending state of the message; may be null
SendingState MessageSendingState `json:"sending_state"`
// The scheduling state of the message; may be null
SchedulingState MessageSchedulingState `json:"scheduling_state"`
// True, if the message is outgoing
IsOutgoing bool `json:"is_outgoing"`
// True, if the message is pinned
IsPinned bool `json:"is_pinned"`
// True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application
CanBeEdited bool `json:"can_be_edited"`
// True, if the message can be forwarded
CanBeForwarded bool `json:"can_be_forwarded"`
// True, if content of the message can be saved locally or copied
CanBeSaved bool `json:"can_be_saved"`
// True, if the message can be deleted only for the current user while other users will continue to see it
CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"`
// True, if the message can be deleted for all users
CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"`
2023-06-04 22:58:07 +02:00
// True, if the list of added reactions is available through getMessageAddedReactions
CanGetAddedReactions bool `json:"can_get_added_reactions"`
// True, if the message statistics are available through getMessageStatistics
2021-12-08 10:23:00 +01:00
CanGetStatistics bool `json:"can_get_statistics"`
2023-06-04 22:58:07 +02:00
// True, if information about the message thread is available through getMessageThread and getMessageThreadHistory
2021-12-08 10:23:00 +01:00
CanGetMessageThread bool `json:"can_get_message_thread"`
// True, if chat members already viewed the message can be received through getMessageViewers
CanGetViewers bool `json:"can_get_viewers"`
2023-06-04 22:58:07 +02:00
// True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink
2021-12-08 10:23:00 +01:00
CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"`
2023-06-04 22:58:07 +02:00
// True, if reactions on the message can be reported through reportMessageReactions
CanReportReactions bool `json:"can_report_reactions"`
2021-12-08 10:23:00 +01:00
// True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message
HasTimestampedMedia bool `json:"has_timestamped_media"`
// True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts
IsChannelPost bool `json:"is_channel_post"`
2023-06-04 22:58:07 +02:00
// True, if the message is a forum topic message
IsTopicMessage bool `json:"is_topic_message"`
2021-12-08 10:23:00 +01:00
// 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
2021-10-22 16:24:12 +02:00
Date int32 `json:"date"`
2021-12-08 10:23:00 +01:00
// Point in time (Unix timestamp) when the message was last edited
EditDate int32 `json:"edit_date"`
// Information about the initial message sender; may be null
ForwardInfo *MessageForwardInfo `json:"forward_info"`
// Information about interactions with the message; may be null
InteractionInfo *MessageInteractionInfo `json:"interaction_info"`
2023-06-04 22:58:07 +02:00
// Information about unread reactions added to the message
UnreadReactions []*UnreadReaction `json:"unread_reactions"`
2021-12-08 10:23:00 +01:00
// If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id
ReplyInChatId int64 `json:"reply_in_chat_id"`
// If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message
ReplyToMessageId int64 `json:"reply_to_message_id"`
// If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs
MessageThreadId int64 `json:"message_thread_id"`
2023-06-04 22:58:07 +02:00
// The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires
SelfDestructTime int32 `json:"self_destruct_time"`
// Time left before the message self-destruct timer expires, in seconds. If the self-destruct timer isn't started yet, equals to the value of the self_destruct_time field
SelfDestructIn float64 `json:"self_destruct_in"`
// Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never. TDLib will send updateDeleteMessages or updateMessageContent once the time expires
AutoDeleteIn float64 `json:"auto_delete_in"`
2021-12-08 10:23:00 +01:00
// If non-zero, the user identifier of the bot through which this message was sent
ViaBotUserId int64 `json:"via_bot_user_id"`
// For channel posts and anonymous group messages, optional author signature
AuthorSignature string `json:"author_signature"`
// Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums
MediaAlbumId JsonInt64 `json:"media_album_id"`
// If non-empty, contains a human-readable description of the reason why access to this message must be restricted
RestrictionReason string `json:"restriction_reason"`
// Content of the message
Content MessageContent `json:"content"`
// Reply markup for the message; may be null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Message) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Message
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Message) GetClass() string {
return ClassMessage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Message) GetType() string {
return TypeMessage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (message *Message) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Id int64 `json:"id"`
SenderId json.RawMessage `json:"sender_id"`
ChatId int64 `json:"chat_id"`
SendingState json.RawMessage `json:"sending_state"`
SchedulingState json.RawMessage `json:"scheduling_state"`
IsOutgoing bool `json:"is_outgoing"`
IsPinned bool `json:"is_pinned"`
CanBeEdited bool `json:"can_be_edited"`
CanBeForwarded bool `json:"can_be_forwarded"`
CanBeSaved bool `json:"can_be_saved"`
CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"`
CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"`
2023-06-04 22:58:07 +02:00
CanGetAddedReactions bool `json:"can_get_added_reactions"`
2021-12-08 10:23:00 +01:00
CanGetStatistics bool `json:"can_get_statistics"`
CanGetMessageThread bool `json:"can_get_message_thread"`
CanGetViewers bool `json:"can_get_viewers"`
CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"`
2023-06-04 22:58:07 +02:00
CanReportReactions bool `json:"can_report_reactions"`
2021-12-08 10:23:00 +01:00
HasTimestampedMedia bool `json:"has_timestamped_media"`
IsChannelPost bool `json:"is_channel_post"`
2023-06-04 22:58:07 +02:00
IsTopicMessage bool `json:"is_topic_message"`
2021-12-08 10:23:00 +01:00
ContainsUnreadMention bool `json:"contains_unread_mention"`
Date int32 `json:"date"`
EditDate int32 `json:"edit_date"`
ForwardInfo *MessageForwardInfo `json:"forward_info"`
InteractionInfo *MessageInteractionInfo `json:"interaction_info"`
2023-06-04 22:58:07 +02:00
UnreadReactions []*UnreadReaction `json:"unread_reactions"`
2021-12-08 10:23:00 +01:00
ReplyInChatId int64 `json:"reply_in_chat_id"`
ReplyToMessageId int64 `json:"reply_to_message_id"`
MessageThreadId int64 `json:"message_thread_id"`
2023-06-04 22:58:07 +02:00
SelfDestructTime int32 `json:"self_destruct_time"`
SelfDestructIn float64 `json:"self_destruct_in"`
AutoDeleteIn float64 `json:"auto_delete_in"`
2021-12-08 10:23:00 +01:00
ViaBotUserId int64 `json:"via_bot_user_id"`
AuthorSignature string `json:"author_signature"`
MediaAlbumId JsonInt64 `json:"media_album_id"`
RestrictionReason string `json:"restriction_reason"`
Content json.RawMessage `json:"content"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
message.Id = tmp.Id
message.ChatId = tmp.ChatId
message.IsOutgoing = tmp.IsOutgoing
message.IsPinned = tmp.IsPinned
message.CanBeEdited = tmp.CanBeEdited
message.CanBeForwarded = tmp.CanBeForwarded
message.CanBeSaved = tmp.CanBeSaved
message.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf
message.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers
2023-06-04 22:58:07 +02:00
message.CanGetAddedReactions = tmp.CanGetAddedReactions
2021-12-08 10:23:00 +01:00
message.CanGetStatistics = tmp.CanGetStatistics
message.CanGetMessageThread = tmp.CanGetMessageThread
message.CanGetViewers = tmp.CanGetViewers
message.CanGetMediaTimestampLinks = tmp.CanGetMediaTimestampLinks
2023-06-04 22:58:07 +02:00
message.CanReportReactions = tmp.CanReportReactions
2021-12-08 10:23:00 +01:00
message.HasTimestampedMedia = tmp.HasTimestampedMedia
message.IsChannelPost = tmp.IsChannelPost
2023-06-04 22:58:07 +02:00
message.IsTopicMessage = tmp.IsTopicMessage
2021-12-08 10:23:00 +01:00
message.ContainsUnreadMention = tmp.ContainsUnreadMention
message.Date = tmp.Date
message.EditDate = tmp.EditDate
message.ForwardInfo = tmp.ForwardInfo
message.InteractionInfo = tmp.InteractionInfo
2023-06-04 22:58:07 +02:00
message.UnreadReactions = tmp.UnreadReactions
2021-12-08 10:23:00 +01:00
message.ReplyInChatId = tmp.ReplyInChatId
message.ReplyToMessageId = tmp.ReplyToMessageId
message.MessageThreadId = tmp.MessageThreadId
2023-06-04 22:58:07 +02:00
message.SelfDestructTime = tmp.SelfDestructTime
message.SelfDestructIn = tmp.SelfDestructIn
message.AutoDeleteIn = tmp.AutoDeleteIn
2021-12-08 10:23:00 +01:00
message.ViaBotUserId = tmp.ViaBotUserId
message.AuthorSignature = tmp.AuthorSignature
message.MediaAlbumId = tmp.MediaAlbumId
message.RestrictionReason = tmp.RestrictionReason
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
message.SenderId = fieldSenderId
fieldSendingState, _ := UnmarshalMessageSendingState(tmp.SendingState)
message.SendingState = fieldSendingState
fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState)
message.SchedulingState = fieldSchedulingState
fieldContent, _ := UnmarshalMessageContent(tmp.Content)
message.Content = fieldContent
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
message.ReplyMarkup = fieldReplyMarkup
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// Contains a list of messages
type Messages struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Approximate total number of messages found
2021-12-08 10:23:00 +01:00
TotalCount int32 `json:"total_count"`
// List of messages; messages may be null
Messages []*Message `json:"messages"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Messages) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Messages
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Messages) GetClass() string {
return ClassMessages
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Messages) GetType() string {
return TypeMessages
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains a list of messages found by a search
type FoundMessages struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Approximate total number of messages found; -1 if unknown
2021-12-08 10:23:00 +01:00
TotalCount int32 `json:"total_count"`
// List of messages
Messages []*Message `json:"messages"`
// The offset for the next request. If empty, there are no more results
NextOffset string `json:"next_offset"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *FoundMessages) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub FoundMessages
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*FoundMessages) GetClass() string {
return ClassFoundMessages
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*FoundMessages) GetType() string {
return TypeFoundMessages
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains a list of messages found by a search in a given chat
type FoundChatMessages struct {
meta
// Approximate total number of messages found; -1 if unknown
TotalCount int32 `json:"total_count"`
// List of messages
Messages []*Message `json:"messages"`
// The offset for the next request. If 0, there are no more results
NextFromMessageId int64 `json:"next_from_message_id"`
}
func (entity *FoundChatMessages) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FoundChatMessages
return json.Marshal((*stub)(entity))
}
func (*FoundChatMessages) GetClass() string {
return ClassFoundChatMessages
}
func (*FoundChatMessages) GetType() string {
return TypeFoundChatMessages
}
2021-12-08 10:23:00 +01:00
// Contains information about a message in a specific position
type MessagePosition struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// 0-based message position in the full list of suitable messages
Position int32 `json:"position"`
// Message identifier
MessageId int64 `json:"message_id"`
// Point in time (Unix timestamp) when the message was sent
Date int32 `json:"date"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessagePosition) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessagePosition
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessagePosition) GetClass() string {
return ClassMessagePosition
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePosition) GetType() string {
return TypeMessagePosition
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains a list of message positions
type MessagePositions struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Total number of messages found
2021-12-08 10:23:00 +01:00
TotalCount int32 `json:"total_count"`
// List of message positions
Positions []*MessagePosition `json:"positions"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessagePositions) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessagePositions
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessagePositions) GetClass() string {
return ClassMessagePositions
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePositions) GetType() string {
return TypeMessagePositions
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// Contains information about found messages sent on a specific day
2021-12-08 10:23:00 +01:00
type MessageCalendarDay struct {
2021-10-22 16:24:12 +02:00
meta
2022-04-18 22:45:01 +02:00
// Total number of found messages sent on the day
2021-12-08 10:23:00 +01:00
TotalCount int32 `json:"total_count"`
2022-04-18 22:45:01 +02:00
// First message sent on the day
2021-12-08 10:23:00 +01:00
Message *Message `json:"message"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageCalendarDay) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageCalendarDay
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageCalendarDay) GetClass() string {
return ClassMessageCalendarDay
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageCalendarDay) GetType() string {
return TypeMessageCalendarDay
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// Contains information about found messages, split by days according to the option "utc_time_offset"
2021-12-08 10:23:00 +01:00
type MessageCalendar struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Total number of found messages
TotalCount int32 `json:"total_count"`
// Information about messages sent
Days []*MessageCalendarDay `json:"days"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageCalendar) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageCalendar
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageCalendar) GetClass() string {
return ClassMessageCalendar
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageCalendar) GetType() string {
return TypeMessageCalendar
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Describes a sponsored message
type SponsoredMessage struct {
2021-10-22 16:24:12 +02:00
meta
2022-04-18 22:45:01 +02:00
// Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages
MessageId int64 `json:"message_id"`
2023-06-04 22:58:07 +02:00
// True, if the message needs to be labeled as "recommended" instead of "sponsored"
IsRecommended bool `json:"is_recommended"`
// Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link
2021-12-08 10:23:00 +01:00
SponsorChatId int64 `json:"sponsor_chat_id"`
2023-06-04 22:58:07 +02:00
// Information about the sponsor chat; may be null unless sponsor_chat_id == 0
SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"`
// True, if the sponsor's chat photo must be shown
ShowChatPhoto bool `json:"show_chat_photo"`
// An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead
2021-12-08 10:23:00 +01:00
Link InternalLinkType `json:"link"`
2022-04-18 22:45:01 +02:00
// Content of the message. Currently, can be only of the type messageText
2021-12-08 10:23:00 +01:00
Content MessageContent `json:"content"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *SponsoredMessage) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SponsoredMessage
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SponsoredMessage) GetClass() string {
return ClassSponsoredMessage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SponsoredMessage) GetType() string {
return TypeSponsoredMessage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error {
var tmp struct {
2023-06-04 22:58:07 +02:00
MessageId int64 `json:"message_id"`
IsRecommended bool `json:"is_recommended"`
SponsorChatId int64 `json:"sponsor_chat_id"`
SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"`
ShowChatPhoto bool `json:"show_chat_photo"`
Link json.RawMessage `json:"link"`
Content json.RawMessage `json:"content"`
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2022-04-18 22:45:01 +02:00
sponsoredMessage.MessageId = tmp.MessageId
2023-06-04 22:58:07 +02:00
sponsoredMessage.IsRecommended = tmp.IsRecommended
2021-12-08 10:23:00 +01:00
sponsoredMessage.SponsorChatId = tmp.SponsorChatId
2023-06-04 22:58:07 +02:00
sponsoredMessage.SponsorChatInfo = tmp.SponsorChatInfo
sponsoredMessage.ShowChatPhoto = tmp.ShowChatPhoto
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldLink, _ := UnmarshalInternalLinkType(tmp.Link)
sponsoredMessage.Link = fieldLink
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldContent, _ := UnmarshalMessageContent(tmp.Content)
sponsoredMessage.Content = fieldContent
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains a list of sponsored messages
type SponsoredMessages struct {
meta
// List of sponsored messages
Messages []*SponsoredMessage `json:"messages"`
// The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages
MessagesBetween int32 `json:"messages_between"`
}
func (entity *SponsoredMessages) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SponsoredMessages
return json.Marshal((*stub)(entity))
}
func (*SponsoredMessages) GetClass() string {
return ClassSponsoredMessages
}
func (*SponsoredMessages) GetType() string {
return TypeSponsoredMessages
}
// Describes a file added to file download list
type FileDownload struct {
meta
// File identifier
FileId int32 `json:"file_id"`
// The message with the file
Message *Message `json:"message"`
// Point in time (Unix timestamp) when the file was added to the download list
AddDate int32 `json:"add_date"`
// Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed
CompleteDate int32 `json:"complete_date"`
// True, if downloading of the file is paused
IsPaused bool `json:"is_paused"`
}
func (entity *FileDownload) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileDownload
return json.Marshal((*stub)(entity))
}
func (*FileDownload) GetClass() string {
return ClassFileDownload
}
func (*FileDownload) GetType() string {
return TypeFileDownload
}
// Contains number of being downloaded and recently downloaded files found
type DownloadedFileCounts struct {
meta
// Number of active file downloads found, including paused
ActiveCount int32 `json:"active_count"`
// Number of paused file downloads found
PausedCount int32 `json:"paused_count"`
// Number of completed file downloads found
CompletedCount int32 `json:"completed_count"`
}
func (entity *DownloadedFileCounts) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DownloadedFileCounts
return json.Marshal((*stub)(entity))
}
func (*DownloadedFileCounts) GetClass() string {
return ClassDownloadedFileCounts
}
func (*DownloadedFileCounts) GetType() string {
return TypeDownloadedFileCounts
}
// Contains a list of downloaded files, found by a search
type FoundFileDownloads struct {
meta
// Total number of suitable files, ignoring offset
TotalCounts *DownloadedFileCounts `json:"total_counts"`
// The list of files
Files []*FileDownload `json:"files"`
// The offset for the next request. If empty, there are no more results
NextOffset string `json:"next_offset"`
}
func (entity *FoundFileDownloads) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FoundFileDownloads
return json.Marshal((*stub)(entity))
}
func (*FoundFileDownloads) GetClass() string {
return ClassFoundFileDownloads
}
func (*FoundFileDownloads) GetType() string {
return TypeFoundFileDownloads
}
2021-12-08 10:23:00 +01:00
// Notification settings applied to all private and secret chats when the corresponding chat setting has a default value
type NotificationSettingsScopePrivateChats struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *NotificationSettingsScopePrivateChats) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub NotificationSettingsScopePrivateChats
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*NotificationSettingsScopePrivateChats) GetClass() string {
return ClassNotificationSettingsScope
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*NotificationSettingsScopePrivateChats) GetType() string {
return TypeNotificationSettingsScopePrivateChats
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*NotificationSettingsScopePrivateChats) NotificationSettingsScopeType() string {
return TypeNotificationSettingsScopePrivateChats
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value
2021-12-08 10:23:00 +01:00
type NotificationSettingsScopeGroupChats struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *NotificationSettingsScopeGroupChats) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub NotificationSettingsScopeGroupChats
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*NotificationSettingsScopeGroupChats) GetClass() string {
return ClassNotificationSettingsScope
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*NotificationSettingsScopeGroupChats) GetType() string {
return TypeNotificationSettingsScopeGroupChats
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*NotificationSettingsScopeGroupChats) NotificationSettingsScopeType() string {
return TypeNotificationSettingsScopeGroupChats
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Notification settings applied to all channel chats when the corresponding chat setting has a default value
2021-12-08 10:23:00 +01:00
type NotificationSettingsScopeChannelChats struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *NotificationSettingsScopeChannelChats) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub NotificationSettingsScopeChannelChats
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*NotificationSettingsScopeChannelChats) GetClass() string {
return ClassNotificationSettingsScope
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*NotificationSettingsScopeChannelChats) GetType() string {
return TypeNotificationSettingsScopeChannelChats
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() string {
return TypeNotificationSettingsScopeChannelChats
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains information about notification settings for a chat or a froum topic
2021-12-08 10:23:00 +01:00
type ChatNotificationSettings struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead
2021-12-08 10:23:00 +01:00
UseDefaultMuteFor bool `json:"use_default_mute_for"`
// Time left before notifications will be unmuted, in seconds
MuteFor int32 `json:"mute_for"`
2023-06-04 22:58:07 +02:00
// If true, the value for the relevant type of chat or the forum chat is used instead of sound_id
2021-12-08 10:23:00 +01:00
UseDefaultSound bool `json:"use_default_sound"`
2023-06-04 22:58:07 +02:00
// Identifier of the notification sound to be played; 0 if sound is disabled
SoundId JsonInt64 `json:"sound_id"`
// If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead
2021-12-08 10:23:00 +01:00
UseDefaultShowPreview bool `json:"use_default_show_preview"`
// True, if message content must be displayed in notifications
ShowPreview bool `json:"show_preview"`
2023-06-04 22:58:07 +02:00
// If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead
2021-12-08 10:23:00 +01:00
UseDefaultDisablePinnedMessageNotifications bool `json:"use_default_disable_pinned_message_notifications"`
// If true, notifications for incoming pinned messages will be created as for an ordinary unread message
DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"`
2023-06-04 22:58:07 +02:00
// If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead
2021-12-08 10:23:00 +01:00
UseDefaultDisableMentionNotifications bool `json:"use_default_disable_mention_notifications"`
// If true, notifications for messages with mentions will be created as for an ordinary unread message
DisableMentionNotifications bool `json:"disable_mention_notifications"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatNotificationSettings) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatNotificationSettings
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatNotificationSettings) GetClass() string {
return ClassChatNotificationSettings
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatNotificationSettings) GetType() string {
return TypeChatNotificationSettings
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about notification settings for several chats
type ScopeNotificationSettings struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Time left before notifications will be unmuted, in seconds
MuteFor int32 `json:"mute_for"`
2023-06-04 22:58:07 +02:00
// Identifier of the notification sound to be played; 0 if sound is disabled
SoundId JsonInt64 `json:"sound_id"`
2021-12-08 10:23:00 +01:00
// True, if message content must be displayed in notifications
ShowPreview bool `json:"show_preview"`
// True, if notifications for incoming pinned messages will be created as for an ordinary unread message
DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"`
// True, if notifications for messages with mentions will be created as for an ordinary unread message
DisableMentionNotifications bool `json:"disable_mention_notifications"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ScopeNotificationSettings) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ScopeNotificationSettings
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ScopeNotificationSettings) GetClass() string {
return ClassScopeNotificationSettings
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ScopeNotificationSettings) GetType() string {
return TypeScopeNotificationSettings
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about a message draft
type DraftMessage struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Identifier of the replied message; 0 if none
2021-12-08 10:23:00 +01:00
ReplyToMessageId int64 `json:"reply_to_message_id"`
// Point in time (Unix timestamp) when the draft was created
Date int32 `json:"date"`
// Content of the message draft; must be of the type inputMessageText
InputMessageText InputMessageContent `json:"input_message_text"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *DraftMessage) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub DraftMessage
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*DraftMessage) GetClass() string {
return ClassDraftMessage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*DraftMessage) GetType() string {
return TypeDraftMessage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
ReplyToMessageId int64 `json:"reply_to_message_id"`
Date int32 `json:"date"`
InputMessageText json.RawMessage `json:"input_message_text"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
draftMessage.ReplyToMessageId = tmp.ReplyToMessageId
draftMessage.Date = tmp.Date
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldInputMessageText, _ := UnmarshalInputMessageContent(tmp.InputMessageText)
draftMessage.InputMessageText = fieldInputMessageText
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// An ordinary chat with a user
type ChatTypePrivate struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// User identifier
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatTypePrivate) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatTypePrivate
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatTypePrivate) GetClass() string {
return ClassChatType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatTypePrivate) GetType() string {
return TypeChatTypePrivate
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatTypePrivate) ChatTypeType() string {
return TypeChatTypePrivate
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A basic group (a chat with 0-200 other users)
type ChatTypeBasicGroup struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Basic group identifier
BasicGroupId int64 `json:"basic_group_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatTypeBasicGroup) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatTypeBasicGroup
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatTypeBasicGroup) GetClass() string {
return ClassChatType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatTypeBasicGroup) GetType() string {
return TypeChatTypeBasicGroup
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatTypeBasicGroup) ChatTypeType() string {
return TypeChatTypeBasicGroup
}
// A supergroup or channel (with unlimited members)
type ChatTypeSupergroup struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Supergroup or channel identifier
SupergroupId int64 `json:"supergroup_id"`
// True, if the supergroup is a channel
IsChannel bool `json:"is_channel"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatTypeSupergroup) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatTypeSupergroup
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatTypeSupergroup) GetClass() string {
return ClassChatType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatTypeSupergroup) GetType() string {
return TypeChatTypeSupergroup
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatTypeSupergroup) ChatTypeType() string {
return TypeChatTypeSupergroup
}
// A secret chat with a user
type ChatTypeSecret struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Secret chat identifier
SecretChatId int32 `json:"secret_chat_id"`
// User identifier of the secret chat peer
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatTypeSecret) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatTypeSecret
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatTypeSecret) GetClass() string {
return ClassChatType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatTypeSecret) GetType() string {
return TypeChatTypeSecret
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatTypeSecret) ChatTypeType() string {
return TypeChatTypeSecret
}
// Represents a filter of user chats
type ChatFilter struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The title of the filter; 1-12 characters without line feeds
Title string `json:"title"`
2023-06-04 22:58:07 +02:00
// The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette". If empty, use getChatFilterDefaultIconName to get default icon name for the filter
2021-12-08 10:23:00 +01:00
IconName string `json:"icon_name"`
2023-06-04 22:58:07 +02:00
// The chat identifiers of pinned chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
2021-12-08 10:23:00 +01:00
PinnedChatIds []int64 `json:"pinned_chat_ids"`
2023-06-04 22:58:07 +02:00
// The chat identifiers of always included chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
2021-12-08 10:23:00 +01:00
IncludedChatIds []int64 `json:"included_chat_ids"`
2023-06-04 22:58:07 +02:00
// The chat identifiers of always excluded chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
2021-12-08 10:23:00 +01:00
ExcludedChatIds []int64 `json:"excluded_chat_ids"`
// True, if muted chats need to be excluded
ExcludeMuted bool `json:"exclude_muted"`
// True, if read chats need to be excluded
ExcludeRead bool `json:"exclude_read"`
// True, if archived chats need to be excluded
ExcludeArchived bool `json:"exclude_archived"`
// True, if contacts need to be included
IncludeContacts bool `json:"include_contacts"`
// True, if non-contact users need to be included
IncludeNonContacts bool `json:"include_non_contacts"`
// True, if bots need to be included
IncludeBots bool `json:"include_bots"`
// True, if basic groups and supergroups need to be included
IncludeGroups bool `json:"include_groups"`
// True, if channels need to be included
IncludeChannels bool `json:"include_channels"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatFilter) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatFilter
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatFilter) GetClass() string {
return ClassChatFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatFilter) GetType() string {
return TypeChatFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains basic information about a chat filter
type ChatFilterInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Unique chat filter identifier
Id int32 `json:"id"`
// The title of the filter; 1-12 characters without line feeds
2021-10-22 16:24:12 +02:00
Title string `json:"title"`
2023-06-04 22:58:07 +02:00
// The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette"
2021-12-08 10:23:00 +01:00
IconName string `json:"icon_name"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatFilterInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatFilterInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatFilterInfo) GetClass() string {
return ClassChatFilterInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatFilterInfo) GetType() string {
return TypeChatFilterInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Describes a recommended chat filter
type RecommendedChatFilter struct {
meta
// The chat filter
Filter *ChatFilter `json:"filter"`
// Chat filter description
Description string `json:"description"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *RecommendedChatFilter) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub RecommendedChatFilter
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*RecommendedChatFilter) GetClass() string {
return ClassRecommendedChatFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RecommendedChatFilter) GetType() string {
return TypeRecommendedChatFilter
}
// Contains a list of recommended chat filters
type RecommendedChatFilters struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of recommended chat filters
ChatFilters []*RecommendedChatFilter `json:"chat_filters"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RecommendedChatFilters) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RecommendedChatFilters
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RecommendedChatFilters) GetClass() string {
return ClassRecommendedChatFilters
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RecommendedChatFilters) GetType() string {
return TypeRecommendedChatFilters
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A main list of chats
type ChatListMain struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatListMain) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatListMain
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatListMain) GetClass() string {
return ClassChatList
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatListMain) GetType() string {
return TypeChatListMain
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatListMain) ChatListType() string {
return TypeChatListMain
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives
type ChatListArchive struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatListArchive) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatListArchive
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatListArchive) GetClass() string {
return ClassChatList
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatListArchive) GetType() string {
return TypeChatListArchive
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatListArchive) ChatListType() string {
return TypeChatListArchive
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A list of chats belonging to a chat filter
type ChatListFilter struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Chat filter identifier
ChatFilterId int32 `json:"chat_filter_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatListFilter) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatListFilter
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatListFilter) GetClass() string {
return ClassChatList
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatListFilter) GetType() string {
return TypeChatListFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatListFilter) ChatListType() string {
return TypeChatListFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains a list of chat lists
type ChatLists struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of chat lists
ChatLists []ChatList `json:"chat_lists"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatLists) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatLists
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatLists) GetClass() string {
return ClassChatLists
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatLists) GetType() string {
return TypeChatLists
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (chatLists *ChatLists) UnmarshalJSON(data []byte) error {
var tmp struct {
ChatLists []json.RawMessage `json:"chat_lists"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldChatLists, _ := UnmarshalListOfChatList(tmp.ChatLists)
chatLists.ChatLists = fieldChatLists
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat is sponsored by the user's MTProxy server
type ChatSourceMtprotoProxy struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatSourceMtprotoProxy) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatSourceMtprotoProxy
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatSourceMtprotoProxy) GetClass() string {
return ClassChatSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatSourceMtprotoProxy) GetType() string {
return TypeChatSourceMtprotoProxy
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatSourceMtprotoProxy) ChatSourceType() string {
return TypeChatSourceMtprotoProxy
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat contains a public service announcement
type ChatSourcePublicServiceAnnouncement struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The type of the announcement
Type string `json:"type"`
// The text of the announcement
Text string `json:"text"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatSourcePublicServiceAnnouncement) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatSourcePublicServiceAnnouncement
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatSourcePublicServiceAnnouncement) GetClass() string {
return ClassChatSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatSourcePublicServiceAnnouncement) GetType() string {
return TypeChatSourcePublicServiceAnnouncement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatSourcePublicServiceAnnouncement) ChatSourceType() string {
return TypeChatSourcePublicServiceAnnouncement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Describes a position of a chat in a chat list
type ChatPosition struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The chat list
List ChatList `json:"list"`
// A parameter used to determine order of the chat in the chat list. Chats must be sorted by the pair (order, chat.id) in descending order
Order JsonInt64 `json:"order"`
// True, if the chat is pinned in the chat list
IsPinned bool `json:"is_pinned"`
// Source of the chat in the chat list; may be null
Source ChatSource `json:"source"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatPosition) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatPosition
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatPosition) GetClass() string {
return ClassChatPosition
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatPosition) GetType() string {
return TypeChatPosition
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (chatPosition *ChatPosition) UnmarshalJSON(data []byte) error {
var tmp struct {
List json.RawMessage `json:"list"`
Order JsonInt64 `json:"order"`
IsPinned bool `json:"is_pinned"`
Source json.RawMessage `json:"source"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
chatPosition.Order = tmp.Order
chatPosition.IsPinned = tmp.IsPinned
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldList, _ := UnmarshalChatList(tmp.List)
chatPosition.List = fieldList
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldSource, _ := UnmarshalChatSource(tmp.Source)
chatPosition.Source = fieldSource
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// All reactions are available in the chat
type ChatAvailableReactionsAll struct {
meta
}
func (entity *ChatAvailableReactionsAll) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatAvailableReactionsAll
return json.Marshal((*stub)(entity))
}
func (*ChatAvailableReactionsAll) GetClass() string {
return ClassChatAvailableReactions
}
func (*ChatAvailableReactionsAll) GetType() string {
return TypeChatAvailableReactionsAll
}
func (*ChatAvailableReactionsAll) ChatAvailableReactionsType() string {
return TypeChatAvailableReactionsAll
}
// Only specific reactions are available in the chat
type ChatAvailableReactionsSome struct {
meta
// The list of reactions
Reactions []ReactionType `json:"reactions"`
}
func (entity *ChatAvailableReactionsSome) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatAvailableReactionsSome
return json.Marshal((*stub)(entity))
}
func (*ChatAvailableReactionsSome) GetClass() string {
return ClassChatAvailableReactions
}
func (*ChatAvailableReactionsSome) GetType() string {
return TypeChatAvailableReactionsSome
}
func (*ChatAvailableReactionsSome) ChatAvailableReactionsType() string {
return TypeChatAvailableReactionsSome
}
func (chatAvailableReactionsSome *ChatAvailableReactionsSome) UnmarshalJSON(data []byte) error {
var tmp struct {
Reactions []json.RawMessage `json:"reactions"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldReactions, _ := UnmarshalListOfReactionType(tmp.Reactions)
chatAvailableReactionsSome.Reactions = fieldReactions
return nil
}
2021-12-08 10:23:00 +01:00
// Describes a video chat
type VideoChat struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
// True, if the video chat has participants
HasParticipants bool `json:"has_participants"`
// Default group call participant identifier to join the video chat; may be null
DefaultParticipantId MessageSender `json:"default_participant_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *VideoChat) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub VideoChat
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*VideoChat) GetClass() string {
return ClassVideoChat
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*VideoChat) GetType() string {
return TypeVideoChat
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (videoChat *VideoChat) UnmarshalJSON(data []byte) error {
var tmp struct {
GroupCallId int32 `json:"group_call_id"`
HasParticipants bool `json:"has_participants"`
DefaultParticipantId json.RawMessage `json:"default_participant_id"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
videoChat.GroupCallId = tmp.GroupCallId
videoChat.HasParticipants = tmp.HasParticipants
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldDefaultParticipantId, _ := UnmarshalMessageSender(tmp.DefaultParticipantId)
videoChat.DefaultParticipantId = fieldDefaultParticipantId
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A chat. (Can be a private chat, basic group, supergroup, or secret chat)
type Chat struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Chat unique identifier
Id int64 `json:"id"`
// Type of the chat
Type ChatType `json:"type"`
// Chat title
Title string `json:"title"`
// Chat photo; may be null
Photo *ChatPhotoInfo `json:"photo"`
// Actions that non-administrator chat members are allowed to take in the chat
Permissions *ChatPermissions `json:"permissions"`
// Last message in the chat; may be null
LastMessage *Message `json:"last_message"`
// Positions of the chat in chat lists
Positions []*ChatPosition `json:"positions"`
2022-04-18 22:45:01 +02:00
// Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender
MessageSenderId MessageSender `json:"message_sender_id"`
2021-12-08 10:23:00 +01:00
// True, if chat content can't be saved locally, forwarded, or copied
HasProtectedContent bool `json:"has_protected_content"`
// True, if the chat is marked as unread
IsMarkedAsUnread bool `json:"is_marked_as_unread"`
// True, if the chat is blocked by the current user and private messages from the chat can't be received
IsBlocked bool `json:"is_blocked"`
// True, if the chat has scheduled messages
HasScheduledMessages bool `json:"has_scheduled_messages"`
// True, if the chat messages can be deleted only for the current user while other users will continue to see the messages
CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"`
// True, if the chat messages can be deleted for all users
CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"`
// True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto
CanBeReported bool `json:"can_be_reported"`
// Default value of the disable_notification parameter, used when a message is sent to the chat
DefaultDisableNotification bool `json:"default_disable_notification"`
// Number of unread messages in the chat
UnreadCount int32 `json:"unread_count"`
// Identifier of the last read incoming message
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
// Identifier of the last read outgoing message
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
// Number of unread messages with a mention/reply in the chat
UnreadMentionCount int32 `json:"unread_mention_count"`
2023-06-04 22:58:07 +02:00
// Number of messages with unread reactions in the chat
UnreadReactionCount int32 `json:"unread_reaction_count"`
// Notification settings for the chat
2021-12-08 10:23:00 +01:00
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
2023-06-04 22:58:07 +02:00
// Types of reaction, available in the chat
AvailableReactions ChatAvailableReactions `json:"available_reactions"`
// Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date
MessageAutoDeleteTime int32 `json:"message_auto_delete_time"`
2021-12-08 10:23:00 +01:00
// If non-empty, name of a theme, set for the chat
ThemeName string `json:"theme_name"`
// Information about actions which must be possible to do through the chat action bar; may be null
ActionBar ChatActionBar `json:"action_bar"`
// Information about video chat of the chat
VideoChat *VideoChat `json:"video_chat"`
// Information about pending join requests; may be null
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
ReplyMarkupMessageId int64 `json:"reply_markup_message_id"`
// A draft of a message in the chat; may be null
DraftMessage *DraftMessage `json:"draft_message"`
// Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used
ClientData string `json:"client_data"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Chat) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Chat
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Chat) GetClass() string {
return ClassChat
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Chat) GetType() string {
return TypeChat
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (chat *Chat) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Id int64 `json:"id"`
Type json.RawMessage `json:"type"`
Title string `json:"title"`
Photo *ChatPhotoInfo `json:"photo"`
Permissions *ChatPermissions `json:"permissions"`
LastMessage *Message `json:"last_message"`
Positions []*ChatPosition `json:"positions"`
2022-04-18 22:45:01 +02:00
MessageSenderId json.RawMessage `json:"message_sender_id"`
2021-12-08 10:23:00 +01:00
HasProtectedContent bool `json:"has_protected_content"`
IsMarkedAsUnread bool `json:"is_marked_as_unread"`
IsBlocked bool `json:"is_blocked"`
HasScheduledMessages bool `json:"has_scheduled_messages"`
CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"`
CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"`
CanBeReported bool `json:"can_be_reported"`
DefaultDisableNotification bool `json:"default_disable_notification"`
UnreadCount int32 `json:"unread_count"`
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
UnreadMentionCount int32 `json:"unread_mention_count"`
2023-06-04 22:58:07 +02:00
UnreadReactionCount int32 `json:"unread_reaction_count"`
2021-12-08 10:23:00 +01:00
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
2023-06-04 22:58:07 +02:00
AvailableReactions json.RawMessage `json:"available_reactions"`
MessageAutoDeleteTime int32 `json:"message_auto_delete_time"`
2021-12-08 10:23:00 +01:00
ThemeName string `json:"theme_name"`
ActionBar json.RawMessage `json:"action_bar"`
VideoChat *VideoChat `json:"video_chat"`
PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"`
ReplyMarkupMessageId int64 `json:"reply_markup_message_id"`
DraftMessage *DraftMessage `json:"draft_message"`
ClientData string `json:"client_data"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
chat.Id = tmp.Id
chat.Title = tmp.Title
chat.Photo = tmp.Photo
chat.Permissions = tmp.Permissions
chat.LastMessage = tmp.LastMessage
chat.Positions = tmp.Positions
chat.HasProtectedContent = tmp.HasProtectedContent
chat.IsMarkedAsUnread = tmp.IsMarkedAsUnread
chat.IsBlocked = tmp.IsBlocked
chat.HasScheduledMessages = tmp.HasScheduledMessages
chat.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf
chat.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers
chat.CanBeReported = tmp.CanBeReported
chat.DefaultDisableNotification = tmp.DefaultDisableNotification
chat.UnreadCount = tmp.UnreadCount
chat.LastReadInboxMessageId = tmp.LastReadInboxMessageId
chat.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId
chat.UnreadMentionCount = tmp.UnreadMentionCount
2023-06-04 22:58:07 +02:00
chat.UnreadReactionCount = tmp.UnreadReactionCount
2021-12-08 10:23:00 +01:00
chat.NotificationSettings = tmp.NotificationSettings
2023-06-04 22:58:07 +02:00
chat.MessageAutoDeleteTime = tmp.MessageAutoDeleteTime
2021-12-08 10:23:00 +01:00
chat.ThemeName = tmp.ThemeName
chat.VideoChat = tmp.VideoChat
chat.PendingJoinRequests = tmp.PendingJoinRequests
chat.ReplyMarkupMessageId = tmp.ReplyMarkupMessageId
chat.DraftMessage = tmp.DraftMessage
chat.ClientData = tmp.ClientData
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldType, _ := UnmarshalChatType(tmp.Type)
chat.Type = fieldType
2022-04-18 22:45:01 +02:00
fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId)
chat.MessageSenderId = fieldMessageSenderId
2021-12-08 10:23:00 +01:00
2023-06-04 22:58:07 +02:00
fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions)
chat.AvailableReactions = fieldAvailableReactions
2021-12-08 10:23:00 +01:00
fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar)
chat.ActionBar = fieldActionBar
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// Represents a list of chats
type Chats struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Approximate total number of chats found
2021-12-08 10:23:00 +01:00
TotalCount int32 `json:"total_count"`
// List of chat identifiers
ChatIds []int64 `json:"chat_ids"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Chats) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Chats
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Chats) GetClass() string {
return ClassChats
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Chats) GetType() string {
return TypeChats
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Describes a chat located nearby
type ChatNearby struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Chat identifier
ChatId int64 `json:"chat_id"`
// Distance to the chat location, in meters
Distance int32 `json:"distance"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatNearby) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatNearby
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatNearby) GetClass() string {
return ClassChatNearby
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatNearby) GetType() string {
return TypeChatNearby
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Represents a list of chats located nearby
type ChatsNearby struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of users nearby
UsersNearby []*ChatNearby `json:"users_nearby"`
// List of location-based supergroups nearby
SupergroupsNearby []*ChatNearby `json:"supergroups_nearby"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatsNearby) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatsNearby
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatsNearby) GetClass() string {
return ClassChatsNearby
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatsNearby) GetType() string {
return TypeChatsNearby
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The chat is public, because it has an active username
2021-12-08 10:23:00 +01:00
type PublicChatTypeHasUsername struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PublicChatTypeHasUsername) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PublicChatTypeHasUsername
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PublicChatTypeHasUsername) GetClass() string {
return ClassPublicChatType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PublicChatTypeHasUsername) GetType() string {
return TypePublicChatTypeHasUsername
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PublicChatTypeHasUsername) PublicChatTypeType() string {
return TypePublicChatTypeHasUsername
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat is public, because it is a location-based supergroup
type PublicChatTypeIsLocationBased struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PublicChatTypeIsLocationBased) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PublicChatTypeIsLocationBased
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PublicChatTypeIsLocationBased) GetClass() string {
return ClassPublicChatType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PublicChatTypeIsLocationBased) GetType() string {
return TypePublicChatTypeIsLocationBased
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string {
return TypePublicChatTypeIsLocationBased
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
2021-12-08 10:23:00 +01:00
type ChatActionBarReportSpam struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// 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"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionBarReportSpam) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionBarReportSpam
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarReportSpam) GetClass() string {
return ClassChatActionBar
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarReportSpam) GetType() string {
return TypeChatActionBarReportSpam
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarReportSpam) ChatActionBarType() string {
return TypeChatActionBarReportSpam
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation
type ChatActionBarReportUnrelatedLocation struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionBarReportUnrelatedLocation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionBarReportUnrelatedLocation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarReportUnrelatedLocation) GetClass() string {
return ClassChatActionBar
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarReportUnrelatedLocation) GetType() string {
return TypeChatActionBarReportUnrelatedLocation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarReportUnrelatedLocation) ChatActionBarType() string {
return TypeChatActionBarReportUnrelatedLocation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat is a recently created group chat to which new members can be invited
type ChatActionBarInviteMembers struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionBarInviteMembers) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionBarInviteMembers
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarInviteMembers) GetClass() string {
return ClassChatActionBar
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarInviteMembers) GetType() string {
return TypeChatActionBarInviteMembers
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarInviteMembers) ChatActionBarType() string {
return TypeChatActionBarInviteMembers
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
2021-12-08 10:23:00 +01:00
type ChatActionBarReportAddBlock struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// 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 peer through searchChatsNearby and this is the distance between the users
Distance int32 `json:"distance"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionBarReportAddBlock) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionBarReportAddBlock
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarReportAddBlock) GetClass() string {
return ClassChatActionBar
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarReportAddBlock) GetType() string {
return TypeChatActionBarReportAddBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarReportAddBlock) ChatActionBarType() string {
return TypeChatActionBarReportAddBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat is a private or secret chat and the other user can be added to the contact list using the method addContact
type ChatActionBarAddContact struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionBarAddContact) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionBarAddContact
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarAddContact) GetClass() string {
return ClassChatActionBar
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarAddContact) GetType() string {
return TypeChatActionBarAddContact
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarAddContact) ChatActionBarType() string {
return TypeChatActionBarAddContact
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat is a private or secret chat with a mutual contact and the user's phone number can be shared with the other user using the method sharePhoneNumber
type ChatActionBarSharePhoneNumber struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionBarSharePhoneNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionBarSharePhoneNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarSharePhoneNumber) GetClass() string {
return ClassChatActionBar
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarSharePhoneNumber) GetType() string {
return TypeChatActionBarSharePhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarSharePhoneNumber) ChatActionBarType() string {
return TypeChatActionBarSharePhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat is a private chat with an administrator of a chat to which the user sent join request
type ChatActionBarJoinRequest struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Title of the chat to which the join request was sent
Title string `json:"title"`
// True, if the join request was sent to a channel chat
IsChannel bool `json:"is_channel"`
// Point in time (Unix timestamp) when the join request was sent
RequestDate int32 `json:"request_date"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionBarJoinRequest) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionBarJoinRequest
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarJoinRequest) GetClass() string {
return ClassChatActionBar
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarJoinRequest) GetType() string {
return TypeChatActionBarJoinRequest
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionBarJoinRequest) ChatActionBarType() string {
return TypeChatActionBarJoinRequest
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A simple button, with text that must be sent when the button is pressed
type KeyboardButtonTypeText struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *KeyboardButtonTypeText) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub KeyboardButtonTypeText
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeText) GetClass() string {
return ClassKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeText) GetType() string {
return TypeKeyboardButtonTypeText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeText) KeyboardButtonTypeType() string {
return TypeKeyboardButtonTypeText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A button that sends the user's phone number when pressed; available only in private chats
type KeyboardButtonTypeRequestPhoneNumber struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *KeyboardButtonTypeRequestPhoneNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub KeyboardButtonTypeRequestPhoneNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeRequestPhoneNumber) GetClass() string {
return ClassKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeRequestPhoneNumber) GetType() string {
return TypeKeyboardButtonTypeRequestPhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeRequestPhoneNumber) KeyboardButtonTypeType() string {
return TypeKeyboardButtonTypeRequestPhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A button that sends the user's location when pressed; available only in private chats
type KeyboardButtonTypeRequestLocation struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *KeyboardButtonTypeRequestLocation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub KeyboardButtonTypeRequestLocation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeRequestLocation) GetClass() string {
return ClassKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeRequestLocation) GetType() string {
return TypeKeyboardButtonTypeRequestLocation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeRequestLocation) KeyboardButtonTypeType() string {
return TypeKeyboardButtonTypeRequestLocation
}
// A button that allows the user to create and send a poll when pressed; available only in private chats
type KeyboardButtonTypeRequestPoll struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// If true, only regular polls must be allowed to create
ForceRegular bool `json:"force_regular"`
// If true, only polls in quiz mode must be allowed to create
ForceQuiz bool `json:"force_quiz"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *KeyboardButtonTypeRequestPoll) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub KeyboardButtonTypeRequestPoll
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeRequestPoll) GetClass() string {
return ClassKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeRequestPoll) GetType() string {
return TypeKeyboardButtonTypeRequestPoll
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButtonTypeRequestPoll) KeyboardButtonTypeType() string {
return TypeKeyboardButtonTypeRequestPoll
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A button that opens a Web App by calling getWebAppUrl
type KeyboardButtonTypeWebApp struct {
2022-04-18 22:45:01 +02:00
meta
2023-06-04 22:58:07 +02:00
// An HTTP URL to pass to getWebAppUrl
Url string `json:"url"`
}
func (entity *KeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub KeyboardButtonTypeWebApp
return json.Marshal((*stub)(entity))
}
func (*KeyboardButtonTypeWebApp) GetClass() string {
return ClassKeyboardButtonType
}
func (*KeyboardButtonTypeWebApp) GetType() string {
return TypeKeyboardButtonTypeWebApp
}
func (*KeyboardButtonTypeWebApp) KeyboardButtonTypeType() string {
return TypeKeyboardButtonTypeWebApp
}
// Represents a single button in a bot keyboard
type KeyboardButton struct {
meta
// Text of the button
2022-04-18 22:45:01 +02:00
Text string `json:"text"`
2021-12-08 10:23:00 +01:00
// Type of the button
Type KeyboardButtonType `json:"type"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *KeyboardButton) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub KeyboardButton
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButton) GetClass() string {
return ClassKeyboardButton
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*KeyboardButton) GetType() string {
return TypeKeyboardButton
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (keyboardButton *KeyboardButton) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text string `json:"text"`
Type json.RawMessage `json:"type"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
keyboardButton.Text = tmp.Text
fieldType, _ := UnmarshalKeyboardButtonType(tmp.Type)
keyboardButton.Type = fieldType
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A button that opens a specified URL
type InlineKeyboardButtonTypeUrl struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// HTTP or tg:// URL to open
Url string `json:"url"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InlineKeyboardButtonTypeUrl) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InlineKeyboardButtonTypeUrl
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeUrl) GetClass() string {
return ClassInlineKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeUrl) GetType() string {
return TypeInlineKeyboardButtonTypeUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string {
return TypeInlineKeyboardButtonTypeUrl
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo
2021-12-08 10:23:00 +01:00
type InlineKeyboardButtonTypeLoginUrl struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// An HTTP URL to pass to getLoginUrlInfo
2021-12-08 10:23:00 +01:00
Url string `json:"url"`
// Unique button identifier
Id int64 `json:"id"`
// If non-empty, new text of the button in forwarded messages
ForwardText string `json:"forward_text"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InlineKeyboardButtonTypeLoginUrl) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InlineKeyboardButtonTypeLoginUrl
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeLoginUrl) GetClass() string {
return ClassInlineKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeLoginUrl) GetType() string {
return TypeInlineKeyboardButtonTypeLoginUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeLoginUrl) InlineKeyboardButtonTypeType() string {
return TypeInlineKeyboardButtonTypeLoginUrl
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A button that opens a Web App by calling openWebApp
type InlineKeyboardButtonTypeWebApp struct {
meta
// An HTTP URL to pass to openWebApp
Url string `json:"url"`
}
func (entity *InlineKeyboardButtonTypeWebApp) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineKeyboardButtonTypeWebApp
return json.Marshal((*stub)(entity))
}
func (*InlineKeyboardButtonTypeWebApp) GetClass() string {
return ClassInlineKeyboardButtonType
}
func (*InlineKeyboardButtonTypeWebApp) GetType() string {
return TypeInlineKeyboardButtonTypeWebApp
}
func (*InlineKeyboardButtonTypeWebApp) InlineKeyboardButtonTypeType() string {
return TypeInlineKeyboardButtonTypeWebApp
}
2021-12-08 10:23:00 +01:00
// A button that sends a callback query to a bot
type InlineKeyboardButtonTypeCallback struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Data to be sent to the bot via a callback query
Data []byte `json:"data"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InlineKeyboardButtonTypeCallback) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InlineKeyboardButtonTypeCallback
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeCallback) GetClass() string {
return ClassInlineKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeCallback) GetType() string {
return TypeInlineKeyboardButtonTypeCallback
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeCallback) InlineKeyboardButtonTypeType() string {
return TypeInlineKeyboardButtonTypeCallback
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot
2021-12-08 10:23:00 +01:00
type InlineKeyboardButtonTypeCallbackWithPassword struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Data to be sent to the bot via a callback query
Data []byte `json:"data"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InlineKeyboardButtonTypeCallbackWithPassword) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InlineKeyboardButtonTypeCallbackWithPassword
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeCallbackWithPassword) GetClass() string {
return ClassInlineKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeCallbackWithPassword) GetType() string {
return TypeInlineKeyboardButtonTypeCallbackWithPassword
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeCallbackWithPassword) InlineKeyboardButtonTypeType() string {
return TypeInlineKeyboardButtonTypeCallbackWithPassword
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame
type InlineKeyboardButtonTypeCallbackGame struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *InlineKeyboardButtonTypeCallbackGame) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InlineKeyboardButtonTypeCallbackGame
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeCallbackGame) GetClass() string {
return ClassInlineKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeCallbackGame) GetType() string {
return TypeInlineKeyboardButtonTypeCallbackGame
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeCallbackGame) InlineKeyboardButtonTypeType() string {
return TypeInlineKeyboardButtonTypeCallbackGame
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A button that forces an inline query to the bot to be inserted in the input field
type InlineKeyboardButtonTypeSwitchInline struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Inline query to be sent to the bot
Query string `json:"query"`
// True, if the inline query must be sent from the current chat
InCurrentChat bool `json:"in_current_chat"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InlineKeyboardButtonTypeSwitchInline) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InlineKeyboardButtonTypeSwitchInline
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeSwitchInline) GetClass() string {
return ClassInlineKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeSwitchInline) GetType() string {
return TypeInlineKeyboardButtonTypeSwitchInline
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeSwitchInline) InlineKeyboardButtonTypeType() string {
return TypeInlineKeyboardButtonTypeSwitchInline
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice
type InlineKeyboardButtonTypeBuy struct {
meta
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *InlineKeyboardButtonTypeBuy) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub InlineKeyboardButtonTypeBuy
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeBuy) GetClass() string {
return ClassInlineKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeBuy) GetType() string {
return TypeInlineKeyboardButtonTypeBuy
}
func (*InlineKeyboardButtonTypeBuy) InlineKeyboardButtonTypeType() string {
return TypeInlineKeyboardButtonTypeBuy
}
2022-04-18 22:45:01 +02:00
// A button with a user reference to be handled in the same way as textEntityTypeMentionName entities
2021-12-08 10:23:00 +01:00
type InlineKeyboardButtonTypeUser struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// User identifier
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InlineKeyboardButtonTypeUser) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InlineKeyboardButtonTypeUser
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeUser) GetClass() string {
return ClassInlineKeyboardButtonType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeUser) GetType() string {
return TypeInlineKeyboardButtonTypeUser
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButtonTypeUser) InlineKeyboardButtonTypeType() string {
return TypeInlineKeyboardButtonTypeUser
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Represents a single button in an inline keyboard
type InlineKeyboardButton struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text of the button
Text string `json:"text"`
// Type of the button
Type InlineKeyboardButtonType `json:"type"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InlineKeyboardButton) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InlineKeyboardButton
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButton) GetClass() string {
return ClassInlineKeyboardButton
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InlineKeyboardButton) GetType() string {
return TypeInlineKeyboardButton
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text string `json:"text"`
Type json.RawMessage `json:"type"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
inlineKeyboardButton.Text = tmp.Text
fieldType, _ := UnmarshalInlineKeyboardButtonType(tmp.Type)
inlineKeyboardButton.Type = fieldType
2021-10-22 16:24:12 +02:00
return nil
}
2023-06-04 22:58:07 +02:00
// 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
2021-12-08 10:23:00 +01:00
type ReplyMarkupRemoveKeyboard struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// True, if the keyboard is removed only for the mentioned users or the target user of a reply
IsPersonal bool `json:"is_personal"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ReplyMarkupRemoveKeyboard) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ReplyMarkupRemoveKeyboard
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ReplyMarkupRemoveKeyboard) GetClass() string {
return ClassReplyMarkup
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ReplyMarkupRemoveKeyboard) GetType() string {
return TypeReplyMarkupRemoveKeyboard
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ReplyMarkupRemoveKeyboard) ReplyMarkupType() string {
return TypeReplyMarkupRemoveKeyboard
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Instructs application to force a reply to this message
type ReplyMarkupForceReply struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// True, if a forced reply must automatically be shown to the current user. For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user of a reply
IsPersonal bool `json:"is_personal"`
// If non-empty, the placeholder to be shown in the input field when the reply is active; 0-64 characters
InputFieldPlaceholder string `json:"input_field_placeholder"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ReplyMarkupForceReply) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ReplyMarkupForceReply
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ReplyMarkupForceReply) GetClass() string {
return ClassReplyMarkup
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ReplyMarkupForceReply) GetType() string {
return TypeReplyMarkupForceReply
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ReplyMarkupForceReply) ReplyMarkupType() string {
return TypeReplyMarkupForceReply
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains a custom keyboard layout to quickly reply to bots
type ReplyMarkupShowKeyboard struct {
meta
// A list of rows of bot keyboard buttons
Rows [][]*KeyboardButton `json:"rows"`
2023-06-04 22:58:07 +02:00
// True, if the keyboard is supposed to be always shown when the ordinary keyboard is hidden
IsPersistent bool `json:"is_persistent"`
2021-12-08 10:23:00 +01:00
// True, if the application needs to resize the keyboard vertically
ResizeKeyboard bool `json:"resize_keyboard"`
// True, if the application needs to hide the keyboard after use
OneTime bool `json:"one_time"`
// True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply
IsPersonal bool `json:"is_personal"`
// If non-empty, the placeholder to be shown in the input field when the keyboard is active; 0-64 characters
InputFieldPlaceholder string `json:"input_field_placeholder"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *ReplyMarkupShowKeyboard) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub ReplyMarkupShowKeyboard
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*ReplyMarkupShowKeyboard) GetClass() string {
return ClassReplyMarkup
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ReplyMarkupShowKeyboard) GetType() string {
return TypeReplyMarkupShowKeyboard
}
func (*ReplyMarkupShowKeyboard) ReplyMarkupType() string {
return TypeReplyMarkupShowKeyboard
}
// Contains an inline keyboard layout
type ReplyMarkupInlineKeyboard struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// A list of rows of inline keyboard buttons
Rows [][]*InlineKeyboardButton `json:"rows"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ReplyMarkupInlineKeyboard) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ReplyMarkupInlineKeyboard
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ReplyMarkupInlineKeyboard) GetClass() string {
return ClassReplyMarkup
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ReplyMarkupInlineKeyboard) GetType() string {
return TypeReplyMarkupInlineKeyboard
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ReplyMarkupInlineKeyboard) ReplyMarkupType() string {
return TypeReplyMarkupInlineKeyboard
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An HTTP url needs to be open
type LoginUrlInfoOpen struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The URL to open
2021-10-22 16:24:12 +02:00
Url string `json:"url"`
2021-12-08 10:23:00 +01:00
// True, if there is no need to show an ordinary open URL confirm
SkipConfirm bool `json:"skip_confirm"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *LoginUrlInfoOpen) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub LoginUrlInfoOpen
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*LoginUrlInfoOpen) GetClass() string {
return ClassLoginUrlInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LoginUrlInfoOpen) GetType() string {
return TypeLoginUrlInfoOpen
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LoginUrlInfoOpen) LoginUrlInfoType() string {
return TypeLoginUrlInfoOpen
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An authorization confirmation dialog needs to be shown to the user
type LoginUrlInfoRequestConfirmation struct {
meta
// An HTTP URL to be opened
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 needs to be requested to give the permission to the bot to send them messages
RequestWriteAccess bool `json:"request_write_access"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *LoginUrlInfoRequestConfirmation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub LoginUrlInfoRequestConfirmation
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*LoginUrlInfoRequestConfirmation) GetClass() string {
return ClassLoginUrlInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LoginUrlInfoRequestConfirmation) GetType() string {
return TypeLoginUrlInfoRequestConfirmation
}
func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string {
return TypeLoginUrlInfoRequestConfirmation
}
2023-06-04 22:58:07 +02:00
// Contains information about a Web App
type WebAppInfo struct {
meta
// Unique identifier for the Web App launch
LaunchId JsonInt64 `json:"launch_id"`
// A Web App URL to open in a web view
Url string `json:"url"`
}
func (entity *WebAppInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub WebAppInfo
return json.Marshal((*stub)(entity))
}
func (*WebAppInfo) GetClass() string {
return ClassWebAppInfo
}
func (*WebAppInfo) GetType() string {
return TypeWebAppInfo
}
2023-06-04 22:53:18 +02:00
// Contains information about a message thread
type MessageThreadInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the chat to which the message thread belongs
ChatId int64 `json:"chat_id"`
// Message thread identifier, unique within the chat
MessageThreadId int64 `json:"message_thread_id"`
2023-06-04 22:58:07 +02:00
// Information about the message thread; may be null for forum topic threads
2021-12-08 10:23:00 +01:00
ReplyInfo *MessageReplyInfo `json:"reply_info"`
// Approximate number of unread messages in the message thread
UnreadMessageCount int32 `json:"unread_message_count"`
// The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)
Messages []*Message `json:"messages"`
// A draft of a message in the message thread; may be null
DraftMessage *DraftMessage `json:"draft_message"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageThreadInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageThreadInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageThreadInfo) GetClass() string {
return ClassMessageThreadInfo
}
func (*MessageThreadInfo) GetType() string {
return TypeMessageThreadInfo
}
2023-06-04 22:58:07 +02:00
// Describes a forum topic icon
type ForumTopicIcon struct {
meta
// Color of the topic icon in RGB format
Color int32 `json:"color"`
// Unique identifier of the custom emoji shown on the topic icon; 0 if none
CustomEmojiId JsonInt64 `json:"custom_emoji_id"`
}
func (entity *ForumTopicIcon) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ForumTopicIcon
return json.Marshal((*stub)(entity))
}
func (*ForumTopicIcon) GetClass() string {
return ClassForumTopicIcon
}
func (*ForumTopicIcon) GetType() string {
return TypeForumTopicIcon
}
// Contains basic information about a forum topic
type ForumTopicInfo struct {
meta
// Message thread identifier of the topic
MessageThreadId int64 `json:"message_thread_id"`
// Name of the topic
Name string `json:"name"`
// Icon of the topic
Icon *ForumTopicIcon `json:"icon"`
// Date the topic was created
CreationDate int32 `json:"creation_date"`
// Identifier of the creator of the topic
CreatorId MessageSender `json:"creator_id"`
// True, if the topic is the General topic list
IsGeneral bool `json:"is_general"`
// True, if the topic was created by the current user
IsOutgoing bool `json:"is_outgoing"`
// True, if the topic is closed
IsClosed bool `json:"is_closed"`
// True, if the topic is hidden above the topic list and closed; for General topic only
IsHidden bool `json:"is_hidden"`
}
func (entity *ForumTopicInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ForumTopicInfo
return json.Marshal((*stub)(entity))
}
func (*ForumTopicInfo) GetClass() string {
return ClassForumTopicInfo
}
func (*ForumTopicInfo) GetType() string {
return TypeForumTopicInfo
}
func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error {
var tmp struct {
MessageThreadId int64 `json:"message_thread_id"`
Name string `json:"name"`
Icon *ForumTopicIcon `json:"icon"`
CreationDate int32 `json:"creation_date"`
CreatorId json.RawMessage `json:"creator_id"`
IsGeneral bool `json:"is_general"`
IsOutgoing bool `json:"is_outgoing"`
IsClosed bool `json:"is_closed"`
IsHidden bool `json:"is_hidden"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
forumTopicInfo.MessageThreadId = tmp.MessageThreadId
forumTopicInfo.Name = tmp.Name
forumTopicInfo.Icon = tmp.Icon
forumTopicInfo.CreationDate = tmp.CreationDate
forumTopicInfo.IsGeneral = tmp.IsGeneral
forumTopicInfo.IsOutgoing = tmp.IsOutgoing
forumTopicInfo.IsClosed = tmp.IsClosed
forumTopicInfo.IsHidden = tmp.IsHidden
fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId)
forumTopicInfo.CreatorId = fieldCreatorId
return nil
}
// Describes a forum topic
type ForumTopic struct {
meta
// Basic information about the topic
Info *ForumTopicInfo `json:"info"`
// Last message in the topic; may be null if unknown
LastMessage *Message `json:"last_message"`
// True, if the topic is pinned in the topic list
IsPinned bool `json:"is_pinned"`
// Number of unread messages in the topic
UnreadCount int32 `json:"unread_count"`
// Identifier of the last read incoming message
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
// Identifier of the last read outgoing message
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
// Number of unread messages with a mention/reply in the topic
UnreadMentionCount int32 `json:"unread_mention_count"`
// Number of messages with unread reactions in the topic
UnreadReactionCount int32 `json:"unread_reaction_count"`
// Notification settings for the topic
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
// A draft of a message in the topic; may be null
DraftMessage *DraftMessage `json:"draft_message"`
}
func (entity *ForumTopic) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ForumTopic
return json.Marshal((*stub)(entity))
}
func (*ForumTopic) GetClass() string {
return ClassForumTopic
}
func (*ForumTopic) GetType() string {
return TypeForumTopic
}
// Describes a list of forum topics
type ForumTopics struct {
meta
// Approximate total number of forum topics found
TotalCount int32 `json:"total_count"`
// List of forum topics
Topics []*ForumTopic `json:"topics"`
// Offset date for the next getForumTopics request
NextOffsetDate int32 `json:"next_offset_date"`
// Offset message identifier for the next getForumTopics request
NextOffsetMessageId int64 `json:"next_offset_message_id"`
// Offset message thread identifier for the next getForumTopics request
NextOffsetMessageThreadId int64 `json:"next_offset_message_thread_id"`
}
func (entity *ForumTopics) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ForumTopics
return json.Marshal((*stub)(entity))
}
func (*ForumTopics) GetClass() string {
return ClassForumTopics
}
func (*ForumTopics) GetType() string {
return TypeForumTopics
}
2021-12-08 10:23:00 +01:00
// A plain text
type RichTextPlain struct {
meta
// Text
Text string `json:"text"`
}
func (entity *RichTextPlain) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub RichTextPlain
return json.Marshal((*stub)(entity))
}
func (*RichTextPlain) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassRichText
}
2021-12-08 10:23:00 +01:00
func (*RichTextPlain) GetType() string {
return TypeRichTextPlain
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextPlain) RichTextType() string {
return TypeRichTextPlain
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A bold rich text
type RichTextBold struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text
2021-10-22 16:24:12 +02:00
Text RichText `json:"text"`
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextBold) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextBold
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextBold) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassRichText
}
2021-12-08 10:23:00 +01:00
func (*RichTextBold) GetType() string {
return TypeRichTextBold
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextBold) RichTextType() string {
return TypeRichTextBold
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (richTextBold *RichTextBold) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldText, _ := UnmarshalRichText(tmp.Text)
2021-12-08 10:23:00 +01:00
richTextBold.Text = fieldText
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// An italicized rich text
type RichTextItalic struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text
Text RichText `json:"text"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextItalic) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextItalic
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextItalic) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassRichText
}
2021-12-08 10:23:00 +01:00
func (*RichTextItalic) GetType() string {
return TypeRichTextItalic
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextItalic) RichTextType() string {
return TypeRichTextItalic
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (richTextItalic *RichTextItalic) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextItalic.Text = fieldText
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// An underlined rich text
type RichTextUnderline struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text
2021-10-22 16:24:12 +02:00
Text RichText `json:"text"`
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextUnderline) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextUnderline
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextUnderline) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextUnderline) GetType() string {
return TypeRichTextUnderline
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextUnderline) RichTextType() string {
return TypeRichTextUnderline
}
func (richTextUnderline *RichTextUnderline) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldText, _ := UnmarshalRichText(tmp.Text)
2021-12-08 10:23:00 +01:00
richTextUnderline.Text = fieldText
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A strikethrough rich text
type RichTextStrikethrough struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text
Text RichText `json:"text"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextStrikethrough) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextStrikethrough
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextStrikethrough) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextStrikethrough) GetType() string {
return TypeRichTextStrikethrough
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextStrikethrough) RichTextType() string {
return TypeRichTextStrikethrough
}
func (richTextStrikethrough *RichTextStrikethrough) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextStrikethrough.Text = fieldText
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A fixed-width rich text
type RichTextFixed struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text
Text RichText `json:"text"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextFixed) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextFixed
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextFixed) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextFixed) GetType() string {
return TypeRichTextFixed
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextFixed) RichTextType() string {
return TypeRichTextFixed
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (richTextFixed *RichTextFixed) UnmarshalJSON(data []byte) error {
var tmp struct {
Text json.RawMessage `json:"text"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextFixed.Text = fieldText
return nil
}
// A rich text URL link
type RichTextUrl struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text
Text RichText `json:"text"`
// URL
Url string `json:"url"`
// True, if the URL has cached instant view server-side
IsCached bool `json:"is_cached"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextUrl) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextUrl
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextUrl) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextUrl) GetType() string {
return TypeRichTextUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextUrl) RichTextType() string {
return TypeRichTextUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (richTextUrl *RichTextUrl) UnmarshalJSON(data []byte) error {
var tmp struct {
Text json.RawMessage `json:"text"`
Url string `json:"url"`
IsCached bool `json:"is_cached"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
richTextUrl.Url = tmp.Url
richTextUrl.IsCached = tmp.IsCached
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextUrl.Text = fieldText
return nil
}
// A rich text email link
type RichTextEmailAddress struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text
Text RichText `json:"text"`
// Email address
EmailAddress string `json:"email_address"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextEmailAddress) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextEmailAddress
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextEmailAddress) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextEmailAddress) GetType() string {
return TypeRichTextEmailAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextEmailAddress) RichTextType() string {
return TypeRichTextEmailAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (richTextEmailAddress *RichTextEmailAddress) UnmarshalJSON(data []byte) error {
var tmp struct {
Text json.RawMessage `json:"text"`
EmailAddress string `json:"email_address"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
richTextEmailAddress.EmailAddress = tmp.EmailAddress
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextEmailAddress.Text = fieldText
return nil
}
// A subscript rich text
type RichTextSubscript struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text
Text RichText `json:"text"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextSubscript) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextSubscript
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextSubscript) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextSubscript) GetType() string {
return TypeRichTextSubscript
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextSubscript) RichTextType() string {
return TypeRichTextSubscript
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (richTextSubscript *RichTextSubscript) UnmarshalJSON(data []byte) error {
var tmp struct {
Text json.RawMessage `json:"text"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextSubscript.Text = fieldText
return nil
}
// A superscript rich text
type RichTextSuperscript struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text
Text RichText `json:"text"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextSuperscript) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextSuperscript
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextSuperscript) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextSuperscript) GetType() string {
return TypeRichTextSuperscript
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextSuperscript) RichTextType() string {
return TypeRichTextSuperscript
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (richTextSuperscript *RichTextSuperscript) UnmarshalJSON(data []byte) error {
var tmp struct {
Text json.RawMessage `json:"text"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextSuperscript.Text = fieldText
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A marked rich text
type RichTextMarked struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text
2021-10-22 16:24:12 +02:00
Text RichText `json:"text"`
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextMarked) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextMarked
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextMarked) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextMarked) GetType() string {
return TypeRichTextMarked
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextMarked) RichTextType() string {
return TypeRichTextMarked
}
func (richTextMarked *RichTextMarked) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldText, _ := UnmarshalRichText(tmp.Text)
2021-12-08 10:23:00 +01:00
richTextMarked.Text = fieldText
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A rich text phone number
type RichTextPhoneNumber struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text
Text RichText `json:"text"`
// Phone number
PhoneNumber string `json:"phone_number"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextPhoneNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextPhoneNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextPhoneNumber) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextPhoneNumber) GetType() string {
return TypeRichTextPhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextPhoneNumber) RichTextType() string {
return TypeRichTextPhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (richTextPhoneNumber *RichTextPhoneNumber) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
PhoneNumber string `json:"phone_number"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
richTextPhoneNumber.PhoneNumber = tmp.PhoneNumber
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextPhoneNumber.Text = fieldText
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A small image inside the text
type RichTextIcon struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The image represented as a document. The image can be in GIF, JPEG or PNG format
Document *Document `json:"document"`
// Width of a bounding box in which the image must be shown; 0 if unknown
Width int32 `json:"width"`
// Height of a bounding box in which the image must be shown; 0 if unknown
Height int32 `json:"height"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextIcon) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextIcon
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextIcon) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextIcon) GetType() string {
return TypeRichTextIcon
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextIcon) RichTextType() string {
return TypeRichTextIcon
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A reference to a richTexts object on the same web page
type RichTextReference struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The text
Text RichText `json:"text"`
// The name of a richTextAnchor object, which is the first element of the target richTexts object
AnchorName string `json:"anchor_name"`
// An HTTP URL, opening the reference
Url string `json:"url"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextReference) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextReference
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextReference) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextReference) GetType() string {
return TypeRichTextReference
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextReference) RichTextType() string {
return TypeRichTextReference
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (richTextReference *RichTextReference) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
AnchorName string `json:"anchor_name"`
Url string `json:"url"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
richTextReference.AnchorName = tmp.AnchorName
richTextReference.Url = tmp.Url
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextReference.Text = fieldText
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// An anchor
type RichTextAnchor struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Anchor name
Name string `json:"name"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextAnchor) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextAnchor
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextAnchor) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextAnchor) GetType() string {
return TypeRichTextAnchor
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextAnchor) RichTextType() string {
return TypeRichTextAnchor
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A link to an anchor on the same web page
type RichTextAnchorLink struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The link text
Text RichText `json:"text"`
// The anchor name. If the name is empty, the link must bring back to top
AnchorName string `json:"anchor_name"`
// An HTTP URL, opening the anchor
Url string `json:"url"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTextAnchorLink) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTextAnchorLink
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTextAnchorLink) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextAnchorLink) GetType() string {
return TypeRichTextAnchorLink
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTextAnchorLink) RichTextType() string {
return TypeRichTextAnchorLink
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (richTextAnchorLink *RichTextAnchorLink) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
AnchorName string `json:"anchor_name"`
Url string `json:"url"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
richTextAnchorLink.AnchorName = tmp.AnchorName
richTextAnchorLink.Url = tmp.Url
fieldText, _ := UnmarshalRichText(tmp.Text)
richTextAnchorLink.Text = fieldText
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A concatenation of rich texts
type RichTexts struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Texts
Texts []RichText `json:"texts"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *RichTexts) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub RichTexts
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*RichTexts) GetClass() string {
return ClassRichText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTexts) GetType() string {
return TypeRichTexts
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*RichTexts) RichTextType() string {
return TypeRichTexts
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (richTexts *RichTexts) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Texts []json.RawMessage `json:"texts"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
fieldTexts, _ := UnmarshalListOfRichText(tmp.Texts)
richTexts.Texts = fieldTexts
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// Contains a caption of an instant view web page block, consisting of a text and a trailing credit
type PageBlockCaption struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Content of the caption
2021-10-22 16:24:12 +02:00
Text RichText `json:"text"`
2021-12-08 10:23:00 +01:00
// Block credit (like HTML tag <cite>)
Credit RichText `json:"credit"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockCaption) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockCaption
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockCaption) GetClass() string {
return ClassPageBlockCaption
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockCaption) GetType() string {
return TypePageBlockCaption
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockCaption *PageBlockCaption) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
Credit json.RawMessage `json:"credit"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldText, _ := UnmarshalRichText(tmp.Text)
2021-12-08 10:23:00 +01:00
pageBlockCaption.Text = fieldText
fieldCredit, _ := UnmarshalRichText(tmp.Credit)
pageBlockCaption.Credit = fieldCredit
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// Describes an item of a list page block
type PageBlockListItem struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Item label
Label string `json:"label"`
// Item blocks
PageBlocks []PageBlock `json:"page_blocks"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockListItem) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockListItem
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockListItem) GetClass() string {
return ClassPageBlockListItem
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockListItem) GetType() string {
return TypePageBlockListItem
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockListItem *PageBlockListItem) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Label string `json:"label"`
PageBlocks []json.RawMessage `json:"page_blocks"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
pageBlockListItem.Label = tmp.Label
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
pageBlockListItem.PageBlocks = fieldPageBlocks
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// The content must be left-aligned
type PageBlockHorizontalAlignmentLeft struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockHorizontalAlignmentLeft) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockHorizontalAlignmentLeft
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHorizontalAlignmentLeft) GetClass() string {
return ClassPageBlockHorizontalAlignment
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHorizontalAlignmentLeft) GetType() string {
return TypePageBlockHorizontalAlignmentLeft
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHorizontalAlignmentLeft) PageBlockHorizontalAlignmentType() string {
return TypePageBlockHorizontalAlignmentLeft
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The content must be center-aligned
type PageBlockHorizontalAlignmentCenter struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockHorizontalAlignmentCenter) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockHorizontalAlignmentCenter
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHorizontalAlignmentCenter) GetClass() string {
return ClassPageBlockHorizontalAlignment
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHorizontalAlignmentCenter) GetType() string {
return TypePageBlockHorizontalAlignmentCenter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHorizontalAlignmentCenter) PageBlockHorizontalAlignmentType() string {
return TypePageBlockHorizontalAlignmentCenter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The content must be right-aligned
type PageBlockHorizontalAlignmentRight struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockHorizontalAlignmentRight) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockHorizontalAlignmentRight
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHorizontalAlignmentRight) GetClass() string {
return ClassPageBlockHorizontalAlignment
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHorizontalAlignmentRight) GetType() string {
return TypePageBlockHorizontalAlignmentRight
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHorizontalAlignmentRight) PageBlockHorizontalAlignmentType() string {
return TypePageBlockHorizontalAlignmentRight
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The content must be top-aligned
type PageBlockVerticalAlignmentTop struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockVerticalAlignmentTop) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockVerticalAlignmentTop
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVerticalAlignmentTop) GetClass() string {
return ClassPageBlockVerticalAlignment
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVerticalAlignmentTop) GetType() string {
return TypePageBlockVerticalAlignmentTop
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVerticalAlignmentTop) PageBlockVerticalAlignmentType() string {
return TypePageBlockVerticalAlignmentTop
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The content must be middle-aligned
type PageBlockVerticalAlignmentMiddle struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockVerticalAlignmentMiddle) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockVerticalAlignmentMiddle
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVerticalAlignmentMiddle) GetClass() string {
return ClassPageBlockVerticalAlignment
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVerticalAlignmentMiddle) GetType() string {
return TypePageBlockVerticalAlignmentMiddle
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVerticalAlignmentMiddle) PageBlockVerticalAlignmentType() string {
return TypePageBlockVerticalAlignmentMiddle
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The content must be bottom-aligned
type PageBlockVerticalAlignmentBottom struct {
meta
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *PageBlockVerticalAlignmentBottom) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub PageBlockVerticalAlignmentBottom
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*PageBlockVerticalAlignmentBottom) GetClass() string {
return ClassPageBlockVerticalAlignment
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVerticalAlignmentBottom) GetType() string {
return TypePageBlockVerticalAlignmentBottom
}
func (*PageBlockVerticalAlignmentBottom) PageBlockVerticalAlignmentType() string {
return TypePageBlockVerticalAlignmentBottom
}
// Represents a cell of a table
type PageBlockTableCell struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Cell text; may be null. If the text is null, then the cell must be invisible
2021-10-22 16:24:12 +02:00
Text RichText `json:"text"`
2021-12-08 10:23:00 +01:00
// True, if it is a header cell
IsHeader bool `json:"is_header"`
// The number of columns the cell spans
Colspan int32 `json:"colspan"`
// The number of rows the cell spans
Rowspan int32 `json:"rowspan"`
// Horizontal cell content alignment
Align PageBlockHorizontalAlignment `json:"align"`
// Vertical cell content alignment
Valign PageBlockVerticalAlignment `json:"valign"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockTableCell) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockTableCell
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockTableCell) GetClass() string {
return ClassPageBlockTableCell
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockTableCell) GetType() string {
return TypePageBlockTableCell
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockTableCell *PageBlockTableCell) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
IsHeader bool `json:"is_header"`
Colspan int32 `json:"colspan"`
Rowspan int32 `json:"rowspan"`
Align json.RawMessage `json:"align"`
Valign json.RawMessage `json:"valign"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
pageBlockTableCell.IsHeader = tmp.IsHeader
pageBlockTableCell.Colspan = tmp.Colspan
pageBlockTableCell.Rowspan = tmp.Rowspan
2021-10-22 16:24:12 +02:00
fieldText, _ := UnmarshalRichText(tmp.Text)
2021-12-08 10:23:00 +01:00
pageBlockTableCell.Text = fieldText
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldAlign, _ := UnmarshalPageBlockHorizontalAlignment(tmp.Align)
pageBlockTableCell.Align = fieldAlign
fieldValign, _ := UnmarshalPageBlockVerticalAlignment(tmp.Valign)
pageBlockTableCell.Valign = fieldValign
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// Contains information about a related article
type PageBlockRelatedArticle struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Related article URL
Url string `json:"url"`
// Article title; may be empty
Title string `json:"title"`
// Article description; may be empty
Description string `json:"description"`
// Article photo; may be null
Photo *Photo `json:"photo"`
// Article author; may be empty
Author string `json:"author"`
// Point in time (Unix timestamp) when the article was published; 0 if unknown
PublishDate int32 `json:"publish_date"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockRelatedArticle) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockRelatedArticle
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockRelatedArticle) GetClass() string {
return ClassPageBlockRelatedArticle
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockRelatedArticle) GetType() string {
return TypePageBlockRelatedArticle
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The title of a page
type PageBlockTitle struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Title
Title RichText `json:"title"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockTitle) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockTitle
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockTitle) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockTitle) GetType() string {
return TypePageBlockTitle
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockTitle) PageBlockType() string {
return TypePageBlockTitle
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockTitle *PageBlockTitle) UnmarshalJSON(data []byte) error {
var tmp struct {
Title json.RawMessage `json:"title"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldTitle, _ := UnmarshalRichText(tmp.Title)
pageBlockTitle.Title = fieldTitle
return nil
}
// The subtitle of a page
type PageBlockSubtitle struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Subtitle
Subtitle RichText `json:"subtitle"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockSubtitle) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockSubtitle
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockSubtitle) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockSubtitle) GetType() string {
return TypePageBlockSubtitle
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockSubtitle) PageBlockType() string {
return TypePageBlockSubtitle
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockSubtitle *PageBlockSubtitle) UnmarshalJSON(data []byte) error {
var tmp struct {
Subtitle json.RawMessage `json:"subtitle"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldSubtitle, _ := UnmarshalRichText(tmp.Subtitle)
pageBlockSubtitle.Subtitle = fieldSubtitle
return nil
}
// The author and publishing date of a page
type PageBlockAuthorDate struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Author
Author RichText `json:"author"`
// Point in time (Unix timestamp) when the article was published; 0 if unknown
PublishDate int32 `json:"publish_date"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockAuthorDate) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockAuthorDate
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockAuthorDate) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockAuthorDate) GetType() string {
return TypePageBlockAuthorDate
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockAuthorDate) PageBlockType() string {
return TypePageBlockAuthorDate
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockAuthorDate *PageBlockAuthorDate) UnmarshalJSON(data []byte) error {
var tmp struct {
Author json.RawMessage `json:"author"`
PublishDate int32 `json:"publish_date"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
pageBlockAuthorDate.PublishDate = tmp.PublishDate
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldAuthor, _ := UnmarshalRichText(tmp.Author)
pageBlockAuthorDate.Author = fieldAuthor
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A header
type PageBlockHeader struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Header
Header RichText `json:"header"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockHeader) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockHeader
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHeader) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHeader) GetType() string {
return TypePageBlockHeader
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockHeader) PageBlockType() string {
return TypePageBlockHeader
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockHeader *PageBlockHeader) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Header json.RawMessage `json:"header"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
fieldHeader, _ := UnmarshalRichText(tmp.Header)
pageBlockHeader.Header = fieldHeader
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A subheader
type PageBlockSubheader struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Subheader
Subheader RichText `json:"subheader"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockSubheader) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockSubheader
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockSubheader) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockSubheader) GetType() string {
return TypePageBlockSubheader
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockSubheader) PageBlockType() string {
return TypePageBlockSubheader
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockSubheader *PageBlockSubheader) UnmarshalJSON(data []byte) error {
var tmp struct {
Subheader json.RawMessage `json:"subheader"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldSubheader, _ := UnmarshalRichText(tmp.Subheader)
pageBlockSubheader.Subheader = fieldSubheader
return nil
}
// A kicker
type PageBlockKicker struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Kicker
Kicker RichText `json:"kicker"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockKicker) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockKicker
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockKicker) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockKicker) GetType() string {
return TypePageBlockKicker
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockKicker) PageBlockType() string {
return TypePageBlockKicker
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockKicker *PageBlockKicker) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Kicker json.RawMessage `json:"kicker"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
fieldKicker, _ := UnmarshalRichText(tmp.Kicker)
pageBlockKicker.Kicker = fieldKicker
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A text paragraph
type PageBlockParagraph struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Paragraph text
Text RichText `json:"text"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockParagraph) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockParagraph
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockParagraph) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockParagraph) GetType() string {
return TypePageBlockParagraph
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockParagraph) PageBlockType() string {
return TypePageBlockParagraph
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockParagraph *PageBlockParagraph) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
fieldText, _ := UnmarshalRichText(tmp.Text)
pageBlockParagraph.Text = fieldText
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A preformatted text paragraph
type PageBlockPreformatted struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Paragraph text
Text RichText `json:"text"`
// Programming language for which the text needs to be formatted
Language string `json:"language"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockPreformatted) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockPreformatted
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockPreformatted) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockPreformatted) GetType() string {
return TypePageBlockPreformatted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockPreformatted) PageBlockType() string {
return TypePageBlockPreformatted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockPreformatted *PageBlockPreformatted) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
Language string `json:"language"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
pageBlockPreformatted.Language = tmp.Language
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldText, _ := UnmarshalRichText(tmp.Text)
pageBlockPreformatted.Text = fieldText
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// The footer of a page
type PageBlockFooter struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Footer
Footer RichText `json:"footer"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockFooter) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockFooter
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockFooter) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockFooter) GetType() string {
return TypePageBlockFooter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockFooter) PageBlockType() string {
return TypePageBlockFooter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockFooter *PageBlockFooter) UnmarshalJSON(data []byte) error {
var tmp struct {
Footer json.RawMessage `json:"footer"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldFooter, _ := UnmarshalRichText(tmp.Footer)
pageBlockFooter.Footer = fieldFooter
return nil
}
// An empty block separating a page
type PageBlockDivider struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockDivider) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockDivider
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockDivider) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockDivider) GetType() string {
return TypePageBlockDivider
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockDivider) PageBlockType() string {
return TypePageBlockDivider
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor
type PageBlockAnchor struct {
meta
// Name of the anchor
Name string `json:"name"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *PageBlockAnchor) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub PageBlockAnchor
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*PageBlockAnchor) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockAnchor) GetType() string {
return TypePageBlockAnchor
}
func (*PageBlockAnchor) PageBlockType() string {
return TypePageBlockAnchor
}
// A list of data blocks
type PageBlockList struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The items of the list
Items []*PageBlockListItem `json:"items"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockList) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockList
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockList) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockList) GetType() string {
return TypePageBlockList
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockList) PageBlockType() string {
return TypePageBlockList
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A block quote
type PageBlockBlockQuote struct {
meta
// Quote text
Text RichText `json:"text"`
// Quote credit
Credit RichText `json:"credit"`
}
func (entity *PageBlockBlockQuote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PageBlockBlockQuote
return json.Marshal((*stub)(entity))
}
func (*PageBlockBlockQuote) GetClass() string {
return ClassPageBlock
}
func (*PageBlockBlockQuote) GetType() string {
return TypePageBlockBlockQuote
}
func (*PageBlockBlockQuote) PageBlockType() string {
return TypePageBlockBlockQuote
}
func (pageBlockBlockQuote *PageBlockBlockQuote) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
Credit json.RawMessage `json:"credit"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
fieldText, _ := UnmarshalRichText(tmp.Text)
pageBlockBlockQuote.Text = fieldText
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldCredit, _ := UnmarshalRichText(tmp.Credit)
pageBlockBlockQuote.Credit = fieldCredit
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A pull quote
type PageBlockPullQuote struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Quote text
Text RichText `json:"text"`
// Quote credit
Credit RichText `json:"credit"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockPullQuote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockPullQuote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockPullQuote) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockPullQuote) GetType() string {
return TypePageBlockPullQuote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockPullQuote) PageBlockType() string {
return TypePageBlockPullQuote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockPullQuote *PageBlockPullQuote) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Text json.RawMessage `json:"text"`
Credit json.RawMessage `json:"credit"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
fieldText, _ := UnmarshalRichText(tmp.Text)
pageBlockPullQuote.Text = fieldText
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldCredit, _ := UnmarshalRichText(tmp.Credit)
pageBlockPullQuote.Credit = fieldCredit
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// An animation
type PageBlockAnimation struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Animation file; may be null
Animation *Animation `json:"animation"`
// Animation caption
2021-10-22 16:24:12 +02:00
Caption *PageBlockCaption `json:"caption"`
2021-12-08 10:23:00 +01:00
// True, if the animation must be played automatically
NeedAutoplay bool `json:"need_autoplay"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockAnimation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockAnimation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockAnimation) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassPageBlock
}
2021-12-08 10:23:00 +01:00
func (*PageBlockAnimation) GetType() string {
return TypePageBlockAnimation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockAnimation) PageBlockType() string {
return TypePageBlockAnimation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An audio file
type PageBlockAudio struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Audio file; may be null
Audio *Audio `json:"audio"`
// Audio file caption
Caption *PageBlockCaption `json:"caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockAudio) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockAudio
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockAudio) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockAudio) GetType() string {
return TypePageBlockAudio
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockAudio) PageBlockType() string {
return TypePageBlockAudio
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A photo
type PageBlockPhoto struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Photo file; may be null
2021-10-22 16:24:12 +02:00
Photo *Photo `json:"photo"`
2021-12-08 10:23:00 +01:00
// Photo caption
Caption *PageBlockCaption `json:"caption"`
// URL that needs to be opened when the photo is clicked
Url string `json:"url"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockPhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockPhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockPhoto) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockPhoto) GetType() string {
return TypePageBlockPhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockPhoto) PageBlockType() string {
return TypePageBlockPhoto
}
// A video
type PageBlockVideo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Video file; may be null
Video *Video `json:"video"`
// Video caption
Caption *PageBlockCaption `json:"caption"`
// True, if the video must be played automatically
NeedAutoplay bool `json:"need_autoplay"`
// True, if the video must be looped
IsLooped bool `json:"is_looped"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockVideo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockVideo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVideo) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVideo) GetType() string {
return TypePageBlockVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVideo) PageBlockType() string {
return TypePageBlockVideo
}
// A voice note
type PageBlockVoiceNote struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Voice note; may be null
VoiceNote *VoiceNote `json:"voice_note"`
// Voice note caption
Caption *PageBlockCaption `json:"caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockVoiceNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockVoiceNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVoiceNote) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVoiceNote) GetType() string {
return TypePageBlockVoiceNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockVoiceNote) PageBlockType() string {
return TypePageBlockVoiceNote
}
// A page cover
type PageBlockCover struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Cover
Cover PageBlock `json:"cover"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockCover) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockCover
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockCover) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockCover) GetType() string {
return TypePageBlockCover
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockCover) PageBlockType() string {
return TypePageBlockCover
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockCover *PageBlockCover) UnmarshalJSON(data []byte) error {
var tmp struct {
Cover json.RawMessage `json:"cover"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldCover, _ := UnmarshalPageBlock(tmp.Cover)
pageBlockCover.Cover = fieldCover
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An embedded web page
type PageBlockEmbedded struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Web page URL, if available
Url string `json:"url"`
// HTML-markup of the embedded page
Html string `json:"html"`
// Poster photo, if available; may be null
PosterPhoto *Photo `json:"poster_photo"`
// Block width; 0 if unknown
Width int32 `json:"width"`
// Block height; 0 if unknown
Height int32 `json:"height"`
// Block caption
Caption *PageBlockCaption `json:"caption"`
// True, if the block must be full width
IsFullWidth bool `json:"is_full_width"`
// True, if scrolling needs to be allowed
AllowScrolling bool `json:"allow_scrolling"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockEmbedded) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockEmbedded
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockEmbedded) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockEmbedded) GetType() string {
return TypePageBlockEmbedded
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockEmbedded) PageBlockType() string {
return TypePageBlockEmbedded
}
// An embedded post
type PageBlockEmbeddedPost struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Web page URL
Url string `json:"url"`
// Post author
Author string `json:"author"`
// Post author photo; may be null
AuthorPhoto *Photo `json:"author_photo"`
// Point in time (Unix timestamp) when the post was created; 0 if unknown
Date int32 `json:"date"`
// Post content
PageBlocks []PageBlock `json:"page_blocks"`
// Post caption
Caption *PageBlockCaption `json:"caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockEmbeddedPost) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockEmbeddedPost
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockEmbeddedPost) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockEmbeddedPost) GetType() string {
return TypePageBlockEmbeddedPost
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockEmbeddedPost) PageBlockType() string {
return TypePageBlockEmbeddedPost
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockEmbeddedPost *PageBlockEmbeddedPost) UnmarshalJSON(data []byte) error {
var tmp struct {
Url string `json:"url"`
Author string `json:"author"`
AuthorPhoto *Photo `json:"author_photo"`
Date int32 `json:"date"`
PageBlocks []json.RawMessage `json:"page_blocks"`
Caption *PageBlockCaption `json:"caption"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
pageBlockEmbeddedPost.Url = tmp.Url
pageBlockEmbeddedPost.Author = tmp.Author
pageBlockEmbeddedPost.AuthorPhoto = tmp.AuthorPhoto
pageBlockEmbeddedPost.Date = tmp.Date
pageBlockEmbeddedPost.Caption = tmp.Caption
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
pageBlockEmbeddedPost.PageBlocks = fieldPageBlocks
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A collage
type PageBlockCollage struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Collage item contents
PageBlocks []PageBlock `json:"page_blocks"`
// Block caption
Caption *PageBlockCaption `json:"caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockCollage) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockCollage
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockCollage) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockCollage) GetType() string {
return TypePageBlockCollage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockCollage) PageBlockType() string {
return TypePageBlockCollage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockCollage *PageBlockCollage) UnmarshalJSON(data []byte) error {
var tmp struct {
PageBlocks []json.RawMessage `json:"page_blocks"`
Caption *PageBlockCaption `json:"caption"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
pageBlockCollage.Caption = tmp.Caption
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
pageBlockCollage.PageBlocks = fieldPageBlocks
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A slideshow
type PageBlockSlideshow struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Slideshow item contents
PageBlocks []PageBlock `json:"page_blocks"`
// Block caption
Caption *PageBlockCaption `json:"caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockSlideshow) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockSlideshow
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockSlideshow) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockSlideshow) GetType() string {
return TypePageBlockSlideshow
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockSlideshow) PageBlockType() string {
return TypePageBlockSlideshow
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockSlideshow *PageBlockSlideshow) UnmarshalJSON(data []byte) error {
var tmp struct {
PageBlocks []json.RawMessage `json:"page_blocks"`
Caption *PageBlockCaption `json:"caption"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
pageBlockSlideshow.Caption = tmp.Caption
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
pageBlockSlideshow.PageBlocks = fieldPageBlocks
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A link to a chat
type PageBlockChatLink struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Chat title
Title string `json:"title"`
// Chat photo; may be null
Photo *ChatPhotoInfo `json:"photo"`
2023-06-04 22:58:07 +02:00
// Chat username by which all other information about the chat can be resolved
2021-12-08 10:23:00 +01:00
Username string `json:"username"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockChatLink) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockChatLink
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockChatLink) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockChatLink) GetType() string {
return TypePageBlockChatLink
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockChatLink) PageBlockType() string {
return TypePageBlockChatLink
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A table
type PageBlockTable struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Table caption
Caption RichText `json:"caption"`
// Table cells
Cells [][]*PageBlockTableCell `json:"cells"`
// True, if the table is bordered
IsBordered bool `json:"is_bordered"`
// True, if the table is striped
IsStriped bool `json:"is_striped"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockTable) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockTable
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockTable) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockTable) GetType() string {
return TypePageBlockTable
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockTable) PageBlockType() string {
return TypePageBlockTable
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockTable *PageBlockTable) UnmarshalJSON(data []byte) error {
var tmp struct {
Caption json.RawMessage `json:"caption"`
Cells [][]*PageBlockTableCell `json:"cells"`
IsBordered bool `json:"is_bordered"`
IsStriped bool `json:"is_striped"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
pageBlockTable.Cells = tmp.Cells
pageBlockTable.IsBordered = tmp.IsBordered
pageBlockTable.IsStriped = tmp.IsStriped
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldCaption, _ := UnmarshalRichText(tmp.Caption)
pageBlockTable.Caption = fieldCaption
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A collapsible block
type PageBlockDetails struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Always visible heading for the block
Header RichText `json:"header"`
// Block contents
PageBlocks []PageBlock `json:"page_blocks"`
// True, if the block is open by default
IsOpen bool `json:"is_open"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockDetails) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockDetails
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockDetails) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockDetails) GetType() string {
return TypePageBlockDetails
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockDetails) PageBlockType() string {
return TypePageBlockDetails
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockDetails *PageBlockDetails) UnmarshalJSON(data []byte) error {
var tmp struct {
Header json.RawMessage `json:"header"`
PageBlocks []json.RawMessage `json:"page_blocks"`
IsOpen bool `json:"is_open"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
pageBlockDetails.IsOpen = tmp.IsOpen
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldHeader, _ := UnmarshalRichText(tmp.Header)
pageBlockDetails.Header = fieldHeader
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
pageBlockDetails.PageBlocks = fieldPageBlocks
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Related articles
type PageBlockRelatedArticles struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Block header
Header RichText `json:"header"`
// List of related articles
Articles []*PageBlockRelatedArticle `json:"articles"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockRelatedArticles) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockRelatedArticles
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockRelatedArticles) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockRelatedArticles) GetType() string {
return TypePageBlockRelatedArticles
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockRelatedArticles) PageBlockType() string {
return TypePageBlockRelatedArticles
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (pageBlockRelatedArticles *PageBlockRelatedArticles) UnmarshalJSON(data []byte) error {
var tmp struct {
Header json.RawMessage `json:"header"`
Articles []*PageBlockRelatedArticle `json:"articles"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
pageBlockRelatedArticles.Articles = tmp.Articles
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldHeader, _ := UnmarshalRichText(tmp.Header)
pageBlockRelatedArticles.Header = fieldHeader
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A map
type PageBlockMap struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Location of the map center
Location *Location `json:"location"`
// Map zoom level
Zoom int32 `json:"zoom"`
// Map width
Width int32 `json:"width"`
// Map height
Height int32 `json:"height"`
// Block caption
Caption *PageBlockCaption `json:"caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PageBlockMap) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PageBlockMap
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PageBlockMap) GetClass() string {
return ClassPageBlock
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockMap) GetType() string {
return TypePageBlockMap
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PageBlockMap) PageBlockType() string {
return TypePageBlockMap
}
// Describes an instant view page for a web page
type WebPageInstantView struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Content of the web page
PageBlocks []PageBlock `json:"page_blocks"`
// Number of the instant view views; 0 if unknown
ViewCount int32 `json:"view_count"`
2022-04-18 22:45:01 +02:00
// Version of the instant view; currently, can be 1 or 2
2021-12-08 10:23:00 +01:00
Version int32 `json:"version"`
// True, if the instant view must be shown from right to left
IsRtl bool `json:"is_rtl"`
// True, if the instant view contains the full page. A network request might be needed to get the full web page instant view
IsFull bool `json:"is_full"`
// An internal link to be opened to leave feedback about the instant view
FeedbackLink InternalLinkType `json:"feedback_link"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *WebPageInstantView) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub WebPageInstantView
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*WebPageInstantView) GetClass() string {
return ClassWebPageInstantView
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*WebPageInstantView) GetType() string {
return TypeWebPageInstantView
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (webPageInstantView *WebPageInstantView) UnmarshalJSON(data []byte) error {
var tmp struct {
PageBlocks []json.RawMessage `json:"page_blocks"`
ViewCount int32 `json:"view_count"`
Version int32 `json:"version"`
IsRtl bool `json:"is_rtl"`
IsFull bool `json:"is_full"`
FeedbackLink json.RawMessage `json:"feedback_link"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
webPageInstantView.ViewCount = tmp.ViewCount
webPageInstantView.Version = tmp.Version
webPageInstantView.IsRtl = tmp.IsRtl
webPageInstantView.IsFull = tmp.IsFull
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
webPageInstantView.PageBlocks = fieldPageBlocks
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldFeedbackLink, _ := UnmarshalInternalLinkType(tmp.FeedbackLink)
webPageInstantView.FeedbackLink = fieldFeedbackLink
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Describes a web page preview
type WebPage struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Original URL of the link
Url string `json:"url"`
// URL to display
DisplayUrl string `json:"display_url"`
// Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else
Type string `json:"type"`
// Short name of the site (e.g., Google Docs, App Store)
SiteName string `json:"site_name"`
// Title of the content
Title string `json:"title"`
// Description of the content
Description *FormattedText `json:"description"`
// Image representing the content; may be null
Photo *Photo `json:"photo"`
// URL to show in the embedded preview
EmbedUrl string `json:"embed_url"`
// MIME type of the embedded preview, (e.g., text/html or video/mp4)
EmbedType string `json:"embed_type"`
// Width of the embedded preview
EmbedWidth int32 `json:"embed_width"`
// Height of the embedded preview
EmbedHeight int32 `json:"embed_height"`
// Duration of the content, in seconds
Duration int32 `json:"duration"`
// Author of the content
Author string `json:"author"`
// Preview of the content as an animation, if available; may be null
Animation *Animation `json:"animation"`
// Preview of the content as an audio file, if available; may be null
Audio *Audio `json:"audio"`
2022-04-18 22:45:01 +02:00
// Preview of the content as a document, if available; may be null
2021-12-08 10:23:00 +01:00
Document *Document `json:"document"`
// Preview of the content as a sticker for small WEBP files, if available; may be null
Sticker *Sticker `json:"sticker"`
// Preview of the content as a video, if available; may be null
Video *Video `json:"video"`
// Preview of the content as a video note, if available; may be null
VideoNote *VideoNote `json:"video_note"`
// Preview of the content as a voice note, if available; may be null
VoiceNote *VoiceNote `json:"voice_note"`
2023-06-04 22:58:07 +02:00
// Version of web page instant view (currently, can be 1 or 2); 0 if none
2021-12-08 10:23:00 +01:00
InstantViewVersion int32 `json:"instant_view_version"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *WebPage) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub WebPage
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*WebPage) GetClass() string {
return ClassWebPage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*WebPage) GetType() string {
return TypeWebPage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about a country
type CountryInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// A two-letter ISO 3166-1 alpha-2 country code
CountryCode string `json:"country_code"`
// Native name of the country
Name string `json:"name"`
// English name of the country
EnglishName string `json:"english_name"`
// True, if the country must be hidden from the list of all countries
IsHidden bool `json:"is_hidden"`
// List of country calling codes
CallingCodes []string `json:"calling_codes"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *CountryInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub CountryInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*CountryInfo) GetClass() string {
return ClassCountryInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*CountryInfo) GetType() string {
return TypeCountryInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about countries
type Countries struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The list of countries
Countries []*CountryInfo `json:"countries"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Countries) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Countries
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Countries) GetClass() string {
return ClassCountries
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Countries) GetType() string {
return TypeCountries
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about a phone number
type PhoneNumberInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Information about the country to which the phone number belongs; may be null
Country *CountryInfo `json:"country"`
// The part of the phone number denoting country calling code or its part
CountryCallingCode string `json:"country_calling_code"`
// The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user
FormattedPhoneNumber string `json:"formatted_phone_number"`
2023-06-04 22:58:07 +02:00
// True, if the phone number was bought on Fragment and isn't tied to a SIM card
IsAnonymous bool `json:"is_anonymous"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PhoneNumberInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PhoneNumberInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PhoneNumberInfo) GetClass() string {
return ClassPhoneNumberInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PhoneNumberInfo) GetType() string {
return TypePhoneNumberInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Describes an action associated with a bank card number
type BankCardActionOpenUrl struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Action text
Text string `json:"text"`
// The URL to be opened
Url string `json:"url"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *BankCardActionOpenUrl) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub BankCardActionOpenUrl
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*BankCardActionOpenUrl) GetClass() string {
return ClassBankCardActionOpenUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*BankCardActionOpenUrl) GetType() string {
return TypeBankCardActionOpenUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Information about a bank card
type BankCardInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Title of the bank card description
Title string `json:"title"`
// Actions that can be done with the bank card number
Actions []*BankCardActionOpenUrl `json:"actions"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *BankCardInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub BankCardInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*BankCardInfo) GetClass() string {
return ClassBankCardInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*BankCardInfo) GetType() string {
return TypeBankCardInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Describes an address
type Address struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// A two-letter ISO 3166-1 alpha-2 country code
CountryCode string `json:"country_code"`
// State, if applicable
State string `json:"state"`
// City
City string `json:"city"`
// First line of the address
StreetLine1 string `json:"street_line1"`
// Second line of the address
StreetLine2 string `json:"street_line2"`
// Address postal code
PostalCode string `json:"postal_code"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Address) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Address
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Address) GetClass() string {
return ClassAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Address) GetType() string {
return TypeAddress
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains parameters of the application theme
type ThemeParameters struct {
meta
// A color of the background in the RGB24 format
BackgroundColor int32 `json:"background_color"`
// A secondary color for the background in the RGB24 format
SecondaryBackgroundColor int32 `json:"secondary_background_color"`
// A color of text in the RGB24 format
TextColor int32 `json:"text_color"`
// A color of hints in the RGB24 format
HintColor int32 `json:"hint_color"`
// A color of links in the RGB24 format
LinkColor int32 `json:"link_color"`
// A color of the buttons in the RGB24 format
ButtonColor int32 `json:"button_color"`
// A color of text on the buttons in the RGB24 format
ButtonTextColor int32 `json:"button_text_color"`
}
func (entity *ThemeParameters) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ThemeParameters
return json.Marshal((*stub)(entity))
}
func (*ThemeParameters) GetClass() string {
return ClassThemeParameters
}
func (*ThemeParameters) GetType() string {
return TypeThemeParameters
}
2021-12-08 10:23:00 +01:00
// Portion of the price of a product (e.g., "delivery cost", "tax amount")
type LabeledPricePart struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Label for this portion of the product price
Label string `json:"label"`
// Currency amount in the smallest units of the currency
Amount int64 `json:"amount"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *LabeledPricePart) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub LabeledPricePart
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*LabeledPricePart) GetClass() string {
return ClassLabeledPricePart
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LabeledPricePart) GetType() string {
return TypeLabeledPricePart
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Product invoice
type Invoice struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// ISO 4217 currency code
Currency string `json:"currency"`
// A list of objects used to calculate the total price of the product
PriceParts []*LabeledPricePart `json:"price_parts"`
// The maximum allowed amount of tip in the smallest units of the currency
MaxTipAmount int64 `json:"max_tip_amount"`
// Suggested amounts of tip in the smallest units of the currency
SuggestedTipAmounts []int64 `json:"suggested_tip_amounts"`
2023-06-04 22:58:07 +02:00
// An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay
RecurringPaymentTermsOfServiceUrl string `json:"recurring_payment_terms_of_service_url"`
2021-12-08 10:23:00 +01:00
// True, if the payment is a test payment
IsTest bool `json:"is_test"`
// True, if the user's name is needed for payment
NeedName bool `json:"need_name"`
// True, if the user's phone number is needed for payment
NeedPhoneNumber bool `json:"need_phone_number"`
// True, if the user's email address is needed for payment
NeedEmailAddress bool `json:"need_email_address"`
// True, if the user's shipping address is needed for payment
NeedShippingAddress bool `json:"need_shipping_address"`
// True, if the user's phone number will be sent to the provider
SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider"`
// True, if the user's email address will be sent to the provider
SendEmailAddressToProvider bool `json:"send_email_address_to_provider"`
// True, if the total price depends on the shipping method
IsFlexible bool `json:"is_flexible"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Invoice) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Invoice
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Invoice) GetClass() string {
return ClassInvoice
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Invoice) GetType() string {
return TypeInvoice
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Order information
type OrderInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Name of the user
Name string `json:"name"`
// Phone number of the user
PhoneNumber string `json:"phone_number"`
// Email address of the user
EmailAddress string `json:"email_address"`
// Shipping address for this order; may be null
ShippingAddress *Address `json:"shipping_address"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *OrderInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub OrderInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*OrderInfo) GetClass() string {
return ClassOrderInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*OrderInfo) GetType() string {
return TypeOrderInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// One shipping option
type ShippingOption struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Shipping option identifier
Id string `json:"id"`
// Option title
Title string `json:"title"`
// A list of objects used to calculate the total shipping costs
PriceParts []*LabeledPricePart `json:"price_parts"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ShippingOption) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ShippingOption
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ShippingOption) GetClass() string {
return ClassShippingOption
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ShippingOption) GetType() string {
return TypeShippingOption
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains information about saved payment credentials
2021-12-08 10:23:00 +01:00
type SavedCredentials struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Unique identifier of the saved credentials
Id string `json:"id"`
// Title of the saved credentials
Title string `json:"title"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *SavedCredentials) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SavedCredentials
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SavedCredentials) GetClass() string {
return ClassSavedCredentials
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SavedCredentials) GetType() string {
return TypeSavedCredentials
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Applies if a user chooses some previously saved payment credentials. To use their previously saved credentials, the user must have a valid temporary password
type InputCredentialsSaved struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the saved credentials
SavedCredentialsId string `json:"saved_credentials_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputCredentialsSaved) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputCredentialsSaved
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsSaved) GetClass() string {
return ClassInputCredentials
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsSaved) GetType() string {
return TypeInputCredentialsSaved
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsSaved) InputCredentialsType() string {
return TypeInputCredentialsSaved
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Applies if a user enters new credentials on a payment provider website
type InputCredentialsNew struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// JSON-encoded data with the credential identifier from the payment provider
Data string `json:"data"`
// True, if the credential identifier can be saved on the server side
AllowSave bool `json:"allow_save"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputCredentialsNew) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputCredentialsNew
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsNew) GetClass() string {
return ClassInputCredentials
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsNew) GetType() string {
return TypeInputCredentialsNew
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsNew) InputCredentialsType() string {
return TypeInputCredentialsNew
}
// Applies if a user enters new credentials using Apple Pay
type InputCredentialsApplePay struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// JSON-encoded data with the credential identifier
Data string `json:"data"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputCredentialsApplePay) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputCredentialsApplePay
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsApplePay) GetClass() string {
return ClassInputCredentials
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsApplePay) GetType() string {
return TypeInputCredentialsApplePay
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsApplePay) InputCredentialsType() string {
return TypeInputCredentialsApplePay
}
// Applies if a user enters new credentials using Google Pay
type InputCredentialsGooglePay struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// JSON-encoded data with the credential identifier
Data string `json:"data"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputCredentialsGooglePay) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputCredentialsGooglePay
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsGooglePay) GetClass() string {
return ClassInputCredentials
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsGooglePay) GetType() string {
return TypeInputCredentialsGooglePay
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputCredentialsGooglePay) InputCredentialsType() string {
return TypeInputCredentialsGooglePay
}
2023-06-04 22:58:07 +02:00
// Smart Glocal payment provider
type PaymentProviderSmartGlocal struct {
meta
// Public payment token
PublicToken string `json:"public_token"`
}
func (entity *PaymentProviderSmartGlocal) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PaymentProviderSmartGlocal
return json.Marshal((*stub)(entity))
}
func (*PaymentProviderSmartGlocal) GetClass() string {
return ClassPaymentProvider
}
func (*PaymentProviderSmartGlocal) GetType() string {
return TypePaymentProviderSmartGlocal
}
func (*PaymentProviderSmartGlocal) PaymentProviderType() string {
return TypePaymentProviderSmartGlocal
}
2021-12-08 10:23:00 +01:00
// Stripe payment provider
2023-06-04 22:58:07 +02:00
type PaymentProviderStripe struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Stripe API publishable key
PublishableKey string `json:"publishable_key"`
// True, if the user country must be provided
NeedCountry bool `json:"need_country"`
// True, if the user ZIP/postal code must be provided
NeedPostalCode bool `json:"need_postal_code"`
// True, if the cardholder name must be provided
NeedCardholderName bool `json:"need_cardholder_name"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PaymentProviderStripe) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PaymentProviderStripe
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PaymentProviderStripe) GetClass() string {
return ClassPaymentProvider
}
func (*PaymentProviderStripe) GetType() string {
return TypePaymentProviderStripe
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PaymentProviderStripe) PaymentProviderType() string {
return TypePaymentProviderStripe
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Some other payment provider, for which a web payment form must be shown
type PaymentProviderOther struct {
2023-06-04 22:53:18 +02:00
meta
2023-06-04 22:58:07 +02:00
// Payment form URL
Url string `json:"url"`
}
func (entity *PaymentProviderOther) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PaymentProviderOther
return json.Marshal((*stub)(entity))
}
func (*PaymentProviderOther) GetClass() string {
return ClassPaymentProvider
}
func (*PaymentProviderOther) GetType() string {
return TypePaymentProviderOther
2023-06-04 22:53:18 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PaymentProviderOther) PaymentProviderType() string {
return TypePaymentProviderOther
}
// Describes an additional payment option
type PaymentOption struct {
meta
// Title for the payment option
Title string `json:"title"`
// Payment form URL to be opened in a web view
Url string `json:"url"`
}
func (entity *PaymentOption) MarshalJSON() ([]byte, error) {
2023-06-04 22:53:18 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PaymentOption
2023-06-04 22:53:18 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PaymentOption) GetClass() string {
return ClassPaymentOption
2023-06-04 22:53:18 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PaymentOption) GetType() string {
return TypePaymentOption
2023-06-04 22:53:18 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about an invoice payment form
type PaymentForm struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The payment form identifier
Id JsonInt64 `json:"id"`
2023-06-04 22:58:07 +02:00
// Full information about the invoice
2021-12-08 10:23:00 +01:00
Invoice *Invoice `json:"invoice"`
// User identifier of the seller bot
SellerBotUserId int64 `json:"seller_bot_user_id"`
// User identifier of the payment provider bot
2023-06-04 22:58:07 +02:00
PaymentProviderUserId int64 `json:"payment_provider_user_id"`
// Information about the payment provider
PaymentProvider PaymentProvider `json:"payment_provider"`
// The list of additional payment options
AdditionalPaymentOptions []*PaymentOption `json:"additional_payment_options"`
2021-12-08 10:23:00 +01:00
// Saved server-side order information; may be null
SavedOrderInfo *OrderInfo `json:"saved_order_info"`
2023-06-04 22:58:07 +02:00
// The list of saved payment credentials
SavedCredentials []*SavedCredentials `json:"saved_credentials"`
2021-12-08 10:23:00 +01:00
// True, if the user can choose to save credentials
CanSaveCredentials bool `json:"can_save_credentials"`
2023-06-04 22:58:07 +02:00
// True, if the user will be able to save credentials, if sets up a 2-step verification password
2021-12-08 10:23:00 +01:00
NeedPassword bool `json:"need_password"`
2023-06-04 22:58:07 +02:00
// Product title
ProductTitle string `json:"product_title"`
// Product description
ProductDescription *FormattedText `json:"product_description"`
// Product photo; may be null
ProductPhoto *Photo `json:"product_photo"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PaymentForm) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PaymentForm
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PaymentForm) GetClass() string {
return ClassPaymentForm
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PaymentForm) GetType() string {
return TypePaymentForm
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (paymentForm *PaymentForm) UnmarshalJSON(data []byte) error {
var tmp struct {
Id JsonInt64 `json:"id"`
Invoice *Invoice `json:"invoice"`
SellerBotUserId int64 `json:"seller_bot_user_id"`
PaymentProviderUserId int64 `json:"payment_provider_user_id"`
PaymentProvider json.RawMessage `json:"payment_provider"`
AdditionalPaymentOptions []*PaymentOption `json:"additional_payment_options"`
SavedOrderInfo *OrderInfo `json:"saved_order_info"`
SavedCredentials []*SavedCredentials `json:"saved_credentials"`
CanSaveCredentials bool `json:"can_save_credentials"`
NeedPassword bool `json:"need_password"`
ProductTitle string `json:"product_title"`
ProductDescription *FormattedText `json:"product_description"`
ProductPhoto *Photo `json:"product_photo"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
paymentForm.Id = tmp.Id
paymentForm.Invoice = tmp.Invoice
paymentForm.SellerBotUserId = tmp.SellerBotUserId
paymentForm.PaymentProviderUserId = tmp.PaymentProviderUserId
paymentForm.AdditionalPaymentOptions = tmp.AdditionalPaymentOptions
paymentForm.SavedOrderInfo = tmp.SavedOrderInfo
paymentForm.SavedCredentials = tmp.SavedCredentials
paymentForm.CanSaveCredentials = tmp.CanSaveCredentials
paymentForm.NeedPassword = tmp.NeedPassword
paymentForm.ProductTitle = tmp.ProductTitle
paymentForm.ProductDescription = tmp.ProductDescription
paymentForm.ProductPhoto = tmp.ProductPhoto
fieldPaymentProvider, _ := UnmarshalPaymentProvider(tmp.PaymentProvider)
paymentForm.PaymentProvider = fieldPaymentProvider
return nil
}
2021-12-08 10:23:00 +01:00
// Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options
type ValidatedOrderInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Temporary identifier of the order information
OrderInfoId string `json:"order_info_id"`
// Available shipping options
ShippingOptions []*ShippingOption `json:"shipping_options"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ValidatedOrderInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ValidatedOrderInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ValidatedOrderInfo) GetClass() string {
return ClassValidatedOrderInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ValidatedOrderInfo) GetType() string {
return TypeValidatedOrderInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains the result of a payment request
type PaymentResult struct {
meta
// True, if the payment request was successful; otherwise the verification_url will be non-empty
Success bool `json:"success"`
// URL for additional payment credentials verification
VerificationUrl string `json:"verification_url"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *PaymentResult) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub PaymentResult
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*PaymentResult) GetClass() string {
return ClassPaymentResult
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PaymentResult) GetType() string {
return TypePaymentResult
}
// Contains information about a successful payment
type PaymentReceipt struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Product title
Title string `json:"title"`
// Product description
2023-06-04 22:58:07 +02:00
Description *FormattedText `json:"description"`
2021-12-08 10:23:00 +01:00
// Product photo; may be null
Photo *Photo `json:"photo"`
// Point in time (Unix timestamp) when the payment was made
Date int32 `json:"date"`
// User identifier of the seller bot
SellerBotUserId int64 `json:"seller_bot_user_id"`
// User identifier of the payment provider bot
2023-06-04 22:58:07 +02:00
PaymentProviderUserId int64 `json:"payment_provider_user_id"`
2021-12-08 10:23:00 +01:00
// Information about the invoice
Invoice *Invoice `json:"invoice"`
// Order information; may be null
OrderInfo *OrderInfo `json:"order_info"`
// Chosen shipping option; may be null
ShippingOption *ShippingOption `json:"shipping_option"`
// Title of the saved credentials chosen by the buyer
CredentialsTitle string `json:"credentials_title"`
// The amount of tip chosen by the buyer in the smallest units of the currency
TipAmount int64 `json:"tip_amount"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PaymentReceipt) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PaymentReceipt
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PaymentReceipt) GetClass() string {
return ClassPaymentReceipt
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PaymentReceipt) GetType() string {
return TypePaymentReceipt
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// An invoice from a message of the type messageInvoice
type InputInvoiceMessage struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Chat identifier of the message
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *InputInvoiceMessage) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub InputInvoiceMessage
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*InputInvoiceMessage) GetClass() string {
return ClassInputInvoice
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*InputInvoiceMessage) GetType() string {
return TypeInputInvoiceMessage
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*InputInvoiceMessage) InputInvoiceType() string {
return TypeInputInvoiceMessage
}
// An invoice from a link of the type internalLinkTypeInvoice
type InputInvoiceName struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Name of the invoice
Name string `json:"name"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *InputInvoiceName) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub InputInvoiceName
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*InputInvoiceName) GetClass() string {
return ClassInputInvoice
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*InputInvoiceName) GetType() string {
return TypeInputInvoiceName
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*InputInvoiceName) InputInvoiceType() string {
return TypeInputInvoiceName
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The media is hidden until the invoice is paid
type MessageExtendedMediaPreview struct {
meta
// Media width; 0 if unknown
Width int32 `json:"width"`
// Media height; 0 if unknown
Height int32 `json:"height"`
// Media duration; 0 if unknown
Duration int32 `json:"duration"`
// Media minithumbnail; may be null
Minithumbnail *Minithumbnail `json:"minithumbnail"`
// Media caption
Caption *FormattedText `json:"caption"`
}
func (entity *MessageExtendedMediaPreview) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageExtendedMediaPreview
return json.Marshal((*stub)(entity))
}
func (*MessageExtendedMediaPreview) GetClass() string {
return ClassMessageExtendedMedia
}
func (*MessageExtendedMediaPreview) GetType() string {
return TypeMessageExtendedMediaPreview
}
func (*MessageExtendedMediaPreview) MessageExtendedMediaType() string {
return TypeMessageExtendedMediaPreview
}
// The media is a photo
type MessageExtendedMediaPhoto struct {
meta
// The photo
Photo *Photo `json:"photo"`
// Photo caption
Caption *FormattedText `json:"caption"`
}
func (entity *MessageExtendedMediaPhoto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageExtendedMediaPhoto
return json.Marshal((*stub)(entity))
}
func (*MessageExtendedMediaPhoto) GetClass() string {
return ClassMessageExtendedMedia
}
func (*MessageExtendedMediaPhoto) GetType() string {
return TypeMessageExtendedMediaPhoto
}
func (*MessageExtendedMediaPhoto) MessageExtendedMediaType() string {
return TypeMessageExtendedMediaPhoto
}
// The media is a video
type MessageExtendedMediaVideo struct {
meta
// The video
Video *Video `json:"video"`
// Photo caption
Caption *FormattedText `json:"caption"`
}
func (entity *MessageExtendedMediaVideo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageExtendedMediaVideo
return json.Marshal((*stub)(entity))
}
func (*MessageExtendedMediaVideo) GetClass() string {
return ClassMessageExtendedMedia
}
func (*MessageExtendedMediaVideo) GetType() string {
return TypeMessageExtendedMediaVideo
}
func (*MessageExtendedMediaVideo) MessageExtendedMediaType() string {
return TypeMessageExtendedMediaVideo
}
// The media is unuspported
type MessageExtendedMediaUnsupported struct {
meta
// Media caption
Caption *FormattedText `json:"caption"`
}
func (entity *MessageExtendedMediaUnsupported) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageExtendedMediaUnsupported
return json.Marshal((*stub)(entity))
}
func (*MessageExtendedMediaUnsupported) GetClass() string {
return ClassMessageExtendedMedia
}
func (*MessageExtendedMediaUnsupported) GetType() string {
return TypeMessageExtendedMediaUnsupported
}
func (*MessageExtendedMediaUnsupported) MessageExtendedMediaType() string {
return TypeMessageExtendedMediaUnsupported
}
// File with the date it was uploaded
type DatedFile struct {
meta
// The file
File *File `json:"file"`
// Point in time (Unix timestamp) when the file was uploaded
Date int32 `json:"date"`
}
func (entity *DatedFile) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DatedFile
return json.Marshal((*stub)(entity))
}
func (*DatedFile) GetClass() string {
return ClassDatedFile
}
func (*DatedFile) GetType() string {
return TypeDatedFile
}
// A Telegram Passport element containing the user's personal details
type PassportElementTypePersonalDetails struct {
meta
}
func (entity *PassportElementTypePersonalDetails) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PassportElementTypePersonalDetails
return json.Marshal((*stub)(entity))
}
func (*PassportElementTypePersonalDetails) GetClass() string {
return ClassPassportElementType
}
func (*PassportElementTypePersonalDetails) GetType() string {
return TypePassportElementTypePersonalDetails
}
func (*PassportElementTypePersonalDetails) PassportElementTypeType() string {
return TypePassportElementTypePersonalDetails
}
// A Telegram Passport element containing the user's passport
2021-12-08 10:23:00 +01:00
type PassportElementTypePassport struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypePassport) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypePassport
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypePassport) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypePassport) GetType() string {
return TypePassportElementTypePassport
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypePassport) PassportElementTypeType() string {
return TypePassportElementTypePassport
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's driver license
type PassportElementTypeDriverLicense struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypeDriverLicense) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypeDriverLicense
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeDriverLicense) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeDriverLicense) GetType() string {
return TypePassportElementTypeDriverLicense
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeDriverLicense) PassportElementTypeType() string {
return TypePassportElementTypeDriverLicense
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's identity card
type PassportElementTypeIdentityCard struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypeIdentityCard) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypeIdentityCard
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeIdentityCard) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeIdentityCard) GetType() string {
return TypePassportElementTypeIdentityCard
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeIdentityCard) PassportElementTypeType() string {
return TypePassportElementTypeIdentityCard
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's internal passport
type PassportElementTypeInternalPassport struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypeInternalPassport) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypeInternalPassport
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeInternalPassport) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeInternalPassport) GetType() string {
return TypePassportElementTypeInternalPassport
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeInternalPassport) PassportElementTypeType() string {
return TypePassportElementTypeInternalPassport
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's address
type PassportElementTypeAddress struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypeAddress) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypeAddress
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeAddress) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeAddress) GetType() string {
return TypePassportElementTypeAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeAddress) PassportElementTypeType() string {
return TypePassportElementTypeAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's utility bill
type PassportElementTypeUtilityBill struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypeUtilityBill) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypeUtilityBill
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeUtilityBill) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeUtilityBill) GetType() string {
return TypePassportElementTypeUtilityBill
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeUtilityBill) PassportElementTypeType() string {
return TypePassportElementTypeUtilityBill
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's bank statement
type PassportElementTypeBankStatement struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypeBankStatement) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypeBankStatement
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeBankStatement) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeBankStatement) GetType() string {
return TypePassportElementTypeBankStatement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeBankStatement) PassportElementTypeType() string {
return TypePassportElementTypeBankStatement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's rental agreement
type PassportElementTypeRentalAgreement struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypeRentalAgreement) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypeRentalAgreement
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeRentalAgreement) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeRentalAgreement) GetType() string {
return TypePassportElementTypeRentalAgreement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeRentalAgreement) PassportElementTypeType() string {
return TypePassportElementTypeRentalAgreement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the registration page of the user's passport
type PassportElementTypePassportRegistration struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypePassportRegistration) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypePassportRegistration
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypePassportRegistration) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypePassportRegistration) GetType() string {
return TypePassportElementTypePassportRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypePassportRegistration) PassportElementTypeType() string {
return TypePassportElementTypePassportRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's temporary registration
type PassportElementTypeTemporaryRegistration struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypeTemporaryRegistration) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypeTemporaryRegistration
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeTemporaryRegistration) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeTemporaryRegistration) GetType() string {
return TypePassportElementTypeTemporaryRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeTemporaryRegistration) PassportElementTypeType() string {
return TypePassportElementTypeTemporaryRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's phone number
type PassportElementTypePhoneNumber struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypePhoneNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypePhoneNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypePhoneNumber) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypePhoneNumber) GetType() string {
return TypePassportElementTypePhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypePhoneNumber) PassportElementTypeType() string {
return TypePassportElementTypePhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's email address
type PassportElementTypeEmailAddress struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTypeEmailAddress) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTypeEmailAddress
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeEmailAddress) GetClass() string {
return ClassPassportElementType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeEmailAddress) GetType() string {
return TypePassportElementTypeEmailAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTypeEmailAddress) PassportElementTypeType() string {
return TypePassportElementTypeEmailAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Represents a date according to the Gregorian calendar
type Date struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Day of the month; 1-31
Day int32 `json:"day"`
// Month; 1-12
Month int32 `json:"month"`
// Year; 1-9999
Year int32 `json:"year"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Date) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Date
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Date) GetClass() string {
return ClassDate
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Date) GetType() string {
return TypeDate
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains the user's personal details
type PersonalDetails struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// First name of the user written in English; 1-255 characters
FirstName string `json:"first_name"`
// Middle name of the user written in English; 0-255 characters
MiddleName string `json:"middle_name"`
// Last name of the user written in English; 1-255 characters
LastName string `json:"last_name"`
// Native first name of the user; 1-255 characters
NativeFirstName string `json:"native_first_name"`
// Native middle name of the user; 0-255 characters
NativeMiddleName string `json:"native_middle_name"`
// Native last name of the user; 1-255 characters
NativeLastName string `json:"native_last_name"`
// Birthdate of the user
Birthdate *Date `json:"birthdate"`
// Gender of the user, "male" or "female"
Gender string `json:"gender"`
// A two-letter ISO 3166-1 alpha-2 country code of the user's country
CountryCode string `json:"country_code"`
// A two-letter ISO 3166-1 alpha-2 country code of the user's residence country
ResidenceCountryCode string `json:"residence_country_code"`
}
func (entity *PersonalDetails) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PersonalDetails
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PersonalDetails) GetClass() string {
return ClassPersonalDetails
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PersonalDetails) GetType() string {
return TypePersonalDetails
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An identity document
type IdentityDocument struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Document number; 1-24 characters
Number string `json:"number"`
// Document expiry date; may be null if not applicable
ExpiryDate *Date `json:"expiry_date"`
// Front side of the document
FrontSide *DatedFile `json:"front_side"`
// Reverse side of the document; only for driver license and identity card; may be null
ReverseSide *DatedFile `json:"reverse_side"`
// Selfie with the document; may be null
Selfie *DatedFile `json:"selfie"`
// List of files containing a certified English translation of the document
Translation []*DatedFile `json:"translation"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *IdentityDocument) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub IdentityDocument
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*IdentityDocument) GetClass() string {
return ClassIdentityDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*IdentityDocument) GetType() string {
return TypeIdentityDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An identity document to be saved to Telegram Passport
type InputIdentityDocument struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Document number; 1-24 characters
Number string `json:"number"`
// Document expiry date; pass null if not applicable
ExpiryDate *Date `json:"expiry_date"`
// Front side of the document
FrontSide InputFile `json:"front_side"`
// Reverse side of the document; only for driver license and identity card; pass null otherwise
ReverseSide InputFile `json:"reverse_side"`
// Selfie with the document; pass null if unavailable
Selfie InputFile `json:"selfie"`
// List of files containing a certified English translation of the document
Translation []InputFile `json:"translation"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputIdentityDocument) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputIdentityDocument
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputIdentityDocument) GetClass() string {
return ClassInputIdentityDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputIdentityDocument) GetType() string {
return TypeInputIdentityDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputIdentityDocument *InputIdentityDocument) UnmarshalJSON(data []byte) error {
var tmp struct {
Number string `json:"number"`
ExpiryDate *Date `json:"expiry_date"`
FrontSide json.RawMessage `json:"front_side"`
ReverseSide json.RawMessage `json:"reverse_side"`
Selfie json.RawMessage `json:"selfie"`
Translation []json.RawMessage `json:"translation"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
inputIdentityDocument.Number = tmp.Number
inputIdentityDocument.ExpiryDate = tmp.ExpiryDate
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldFrontSide, _ := UnmarshalInputFile(tmp.FrontSide)
inputIdentityDocument.FrontSide = fieldFrontSide
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldReverseSide, _ := UnmarshalInputFile(tmp.ReverseSide)
inputIdentityDocument.ReverseSide = fieldReverseSide
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldSelfie, _ := UnmarshalInputFile(tmp.Selfie)
inputIdentityDocument.Selfie = fieldSelfie
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldTranslation, _ := UnmarshalListOfInputFile(tmp.Translation)
inputIdentityDocument.Translation = fieldTranslation
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A personal document, containing some information about a user
type PersonalDocument struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of files containing the pages of the document
Files []*DatedFile `json:"files"`
// List of files containing a certified English translation of the document
Translation []*DatedFile `json:"translation"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PersonalDocument) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PersonalDocument
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PersonalDocument) GetClass() string {
return ClassPersonalDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PersonalDocument) GetType() string {
return TypePersonalDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A personal document to be saved to Telegram Passport
type InputPersonalDocument struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of files containing the pages of the document
Files []InputFile `json:"files"`
// List of files containing a certified English translation of the document
Translation []InputFile `json:"translation"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPersonalDocument) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPersonalDocument
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPersonalDocument) GetClass() string {
return ClassInputPersonalDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPersonalDocument) GetType() string {
return TypeInputPersonalDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputPersonalDocument *InputPersonalDocument) UnmarshalJSON(data []byte) error {
var tmp struct {
Files []json.RawMessage `json:"files"`
Translation []json.RawMessage `json:"translation"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldFiles, _ := UnmarshalListOfInputFile(tmp.Files)
inputPersonalDocument.Files = fieldFiles
fieldTranslation, _ := UnmarshalListOfInputFile(tmp.Translation)
inputPersonalDocument.Translation = fieldTranslation
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's personal details
type PassportElementPersonalDetails struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Personal details of the user
PersonalDetails *PersonalDetails `json:"personal_details"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementPersonalDetails) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementPersonalDetails
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPersonalDetails) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPersonalDetails) GetType() string {
return TypePassportElementPersonalDetails
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPersonalDetails) PassportElementType() string {
return TypePassportElementPersonalDetails
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's passport
type PassportElementPassport struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Passport
Passport *IdentityDocument `json:"passport"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementPassport) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementPassport
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPassport) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPassport) GetType() string {
return TypePassportElementPassport
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPassport) PassportElementType() string {
return TypePassportElementPassport
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's driver license
type PassportElementDriverLicense struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Driver license
DriverLicense *IdentityDocument `json:"driver_license"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementDriverLicense) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementDriverLicense
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementDriverLicense) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementDriverLicense) GetType() string {
return TypePassportElementDriverLicense
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementDriverLicense) PassportElementType() string {
return TypePassportElementDriverLicense
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's identity card
type PassportElementIdentityCard struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identity card
IdentityCard *IdentityDocument `json:"identity_card"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementIdentityCard) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementIdentityCard
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementIdentityCard) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementIdentityCard) GetType() string {
return TypePassportElementIdentityCard
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementIdentityCard) PassportElementType() string {
return TypePassportElementIdentityCard
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's internal passport
type PassportElementInternalPassport struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Internal passport
InternalPassport *IdentityDocument `json:"internal_passport"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementInternalPassport) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementInternalPassport
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementInternalPassport) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementInternalPassport) GetType() string {
return TypePassportElementInternalPassport
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementInternalPassport) PassportElementType() string {
return TypePassportElementInternalPassport
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's address
type PassportElementAddress struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Address
Address *Address `json:"address"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementAddress) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementAddress
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementAddress) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementAddress) GetType() string {
return TypePassportElementAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementAddress) PassportElementType() string {
return TypePassportElementAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's utility bill
type PassportElementUtilityBill struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Utility bill
UtilityBill *PersonalDocument `json:"utility_bill"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementUtilityBill) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementUtilityBill
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementUtilityBill) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementUtilityBill) GetType() string {
return TypePassportElementUtilityBill
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementUtilityBill) PassportElementType() string {
return TypePassportElementUtilityBill
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's bank statement
type PassportElementBankStatement struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Bank statement
BankStatement *PersonalDocument `json:"bank_statement"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementBankStatement) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementBankStatement
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementBankStatement) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementBankStatement) GetType() string {
return TypePassportElementBankStatement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementBankStatement) PassportElementType() string {
return TypePassportElementBankStatement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's rental agreement
type PassportElementRentalAgreement struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Rental agreement
RentalAgreement *PersonalDocument `json:"rental_agreement"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementRentalAgreement) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementRentalAgreement
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementRentalAgreement) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementRentalAgreement) GetType() string {
return TypePassportElementRentalAgreement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementRentalAgreement) PassportElementType() string {
return TypePassportElementRentalAgreement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's passport registration pages
type PassportElementPassportRegistration struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Passport registration pages
PassportRegistration *PersonalDocument `json:"passport_registration"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementPassportRegistration) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementPassportRegistration
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPassportRegistration) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPassportRegistration) GetType() string {
return TypePassportElementPassportRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPassportRegistration) PassportElementType() string {
return TypePassportElementPassportRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's temporary registration
type PassportElementTemporaryRegistration struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Temporary registration
TemporaryRegistration *PersonalDocument `json:"temporary_registration"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementTemporaryRegistration) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementTemporaryRegistration
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTemporaryRegistration) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTemporaryRegistration) GetType() string {
return TypePassportElementTemporaryRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementTemporaryRegistration) PassportElementType() string {
return TypePassportElementTemporaryRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's phone number
type PassportElementPhoneNumber struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Phone number
PhoneNumber string `json:"phone_number"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementPhoneNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementPhoneNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPhoneNumber) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPhoneNumber) GetType() string {
return TypePassportElementPhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementPhoneNumber) PassportElementType() string {
return TypePassportElementPhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element containing the user's email address
type PassportElementEmailAddress struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Email address
EmailAddress string `json:"email_address"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementEmailAddress) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementEmailAddress
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementEmailAddress) GetClass() string {
return ClassPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementEmailAddress) GetType() string {
return TypePassportElementEmailAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementEmailAddress) PassportElementType() string {
return TypePassportElementEmailAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element to be saved containing the user's personal details
type InputPassportElementPersonalDetails struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Personal details of the user
PersonalDetails *PersonalDetails `json:"personal_details"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementPersonalDetails) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementPersonalDetails
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPersonalDetails) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPersonalDetails) GetType() string {
return TypeInputPassportElementPersonalDetails
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPersonalDetails) InputPassportElementType() string {
return TypeInputPassportElementPersonalDetails
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element to be saved containing the user's passport
type InputPassportElementPassport struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The passport to be saved
Passport *InputIdentityDocument `json:"passport"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementPassport) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementPassport
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPassport) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPassport) GetType() string {
return TypeInputPassportElementPassport
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPassport) InputPassportElementType() string {
return TypeInputPassportElementPassport
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element to be saved containing the user's driver license
type InputPassportElementDriverLicense struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The driver license to be saved
DriverLicense *InputIdentityDocument `json:"driver_license"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementDriverLicense) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementDriverLicense
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementDriverLicense) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementDriverLicense) GetType() string {
return TypeInputPassportElementDriverLicense
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementDriverLicense) InputPassportElementType() string {
return TypeInputPassportElementDriverLicense
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element to be saved containing the user's identity card
type InputPassportElementIdentityCard struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The identity card to be saved
IdentityCard *InputIdentityDocument `json:"identity_card"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementIdentityCard) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementIdentityCard
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementIdentityCard) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementIdentityCard) GetType() string {
return TypeInputPassportElementIdentityCard
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementIdentityCard) InputPassportElementType() string {
return TypeInputPassportElementIdentityCard
}
// A Telegram Passport element to be saved containing the user's internal passport
type InputPassportElementInternalPassport struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The internal passport to be saved
InternalPassport *InputIdentityDocument `json:"internal_passport"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementInternalPassport) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementInternalPassport
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementInternalPassport) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementInternalPassport) GetType() string {
return TypeInputPassportElementInternalPassport
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementInternalPassport) InputPassportElementType() string {
return TypeInputPassportElementInternalPassport
}
// A Telegram Passport element to be saved containing the user's address
type InputPassportElementAddress struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The address to be saved
Address *Address `json:"address"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementAddress) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementAddress
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementAddress) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementAddress) GetType() string {
return TypeInputPassportElementAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementAddress) InputPassportElementType() string {
return TypeInputPassportElementAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element to be saved containing the user's utility bill
type InputPassportElementUtilityBill struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The utility bill to be saved
UtilityBill *InputPersonalDocument `json:"utility_bill"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementUtilityBill) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementUtilityBill
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementUtilityBill) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementUtilityBill) GetType() string {
return TypeInputPassportElementUtilityBill
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementUtilityBill) InputPassportElementType() string {
return TypeInputPassportElementUtilityBill
}
// A Telegram Passport element to be saved containing the user's bank statement
type InputPassportElementBankStatement struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The bank statement to be saved
BankStatement *InputPersonalDocument `json:"bank_statement"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementBankStatement) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementBankStatement
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementBankStatement) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementBankStatement) GetType() string {
return TypeInputPassportElementBankStatement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementBankStatement) InputPassportElementType() string {
return TypeInputPassportElementBankStatement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element to be saved containing the user's rental agreement
type InputPassportElementRentalAgreement struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The rental agreement to be saved
RentalAgreement *InputPersonalDocument `json:"rental_agreement"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementRentalAgreement) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementRentalAgreement
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementRentalAgreement) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementRentalAgreement) GetType() string {
return TypeInputPassportElementRentalAgreement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementRentalAgreement) InputPassportElementType() string {
return TypeInputPassportElementRentalAgreement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element to be saved containing the user's passport registration
type InputPassportElementPassportRegistration struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The passport registration page to be saved
PassportRegistration *InputPersonalDocument `json:"passport_registration"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementPassportRegistration) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementPassportRegistration
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPassportRegistration) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPassportRegistration) GetType() string {
return TypeInputPassportElementPassportRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPassportRegistration) InputPassportElementType() string {
return TypeInputPassportElementPassportRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element to be saved containing the user's temporary registration
type InputPassportElementTemporaryRegistration struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The temporary registration document to be saved
TemporaryRegistration *InputPersonalDocument `json:"temporary_registration"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementTemporaryRegistration) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementTemporaryRegistration
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementTemporaryRegistration) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementTemporaryRegistration) GetType() string {
return TypeInputPassportElementTemporaryRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementTemporaryRegistration) InputPassportElementType() string {
return TypeInputPassportElementTemporaryRegistration
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element to be saved containing the user's phone number
type InputPassportElementPhoneNumber struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The phone number to be saved
PhoneNumber string `json:"phone_number"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementPhoneNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementPhoneNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPhoneNumber) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPhoneNumber) GetType() string {
return TypeInputPassportElementPhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementPhoneNumber) InputPassportElementType() string {
return TypeInputPassportElementPhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A Telegram Passport element to be saved containing the user's email address
type InputPassportElementEmailAddress struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The email address to be saved
EmailAddress string `json:"email_address"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementEmailAddress) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementEmailAddress
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementEmailAddress) GetClass() string {
return ClassInputPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementEmailAddress) GetType() string {
return TypeInputPassportElementEmailAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementEmailAddress) InputPassportElementType() string {
return TypeInputPassportElementEmailAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about saved Telegram Passport elements
type PassportElements struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Telegram Passport elements
Elements []PassportElement `json:"elements"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElements) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElements
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElements) GetClass() string {
return ClassPassportElements
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElements) GetType() string {
return TypePassportElements
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (passportElements *PassportElements) UnmarshalJSON(data []byte) error {
var tmp struct {
Elements []json.RawMessage `json:"elements"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldElements, _ := UnmarshalListOfPassportElement(tmp.Elements)
passportElements.Elements = fieldElements
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The element contains an error in an unspecified place. The error will be considered resolved when new data is added
type PassportElementErrorSourceUnspecified struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementErrorSourceUnspecified) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementErrorSourceUnspecified
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceUnspecified) GetClass() string {
return ClassPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceUnspecified) GetType() string {
return TypePassportElementErrorSourceUnspecified
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceUnspecified) PassportElementErrorSourceType() string {
return TypePassportElementErrorSourceUnspecified
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// One of the data fields contains an error. The error will be considered resolved when the value of the field changes
type PassportElementErrorSourceDataField struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Field name
FieldName string `json:"field_name"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementErrorSourceDataField) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementErrorSourceDataField
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceDataField) GetClass() string {
return ClassPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceDataField) GetType() string {
return TypePassportElementErrorSourceDataField
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceDataField) PassportElementErrorSourceType() string {
return TypePassportElementErrorSourceDataField
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The front side of the document contains an error. The error will be considered resolved when the file with the front side changes
type PassportElementErrorSourceFrontSide struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementErrorSourceFrontSide) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementErrorSourceFrontSide
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceFrontSide) GetClass() string {
return ClassPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceFrontSide) GetType() string {
return TypePassportElementErrorSourceFrontSide
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceFrontSide) PassportElementErrorSourceType() string {
return TypePassportElementErrorSourceFrontSide
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The reverse side of the document contains an error. The error will be considered resolved when the file with the reverse side changes
type PassportElementErrorSourceReverseSide struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementErrorSourceReverseSide) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementErrorSourceReverseSide
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceReverseSide) GetClass() string {
return ClassPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceReverseSide) GetType() string {
return TypePassportElementErrorSourceReverseSide
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceReverseSide) PassportElementErrorSourceType() string {
return TypePassportElementErrorSourceReverseSide
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes
type PassportElementErrorSourceSelfie struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementErrorSourceSelfie) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementErrorSourceSelfie
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceSelfie) GetClass() string {
return ClassPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceSelfie) GetType() string {
return TypePassportElementErrorSourceSelfie
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceSelfie) PassportElementErrorSourceType() string {
return TypePassportElementErrorSourceSelfie
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// One of files with the translation of the document contains an error. The error will be considered resolved when the file changes
type PassportElementErrorSourceTranslationFile struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Index of a file with the error
FileIndex int32 `json:"file_index"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementErrorSourceTranslationFile) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementErrorSourceTranslationFile
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceTranslationFile) GetClass() string {
return ClassPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceTranslationFile) GetType() string {
return TypePassportElementErrorSourceTranslationFile
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceTranslationFile) PassportElementErrorSourceType() string {
return TypePassportElementErrorSourceTranslationFile
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The translation of the document contains an error. The error will be considered resolved when the list of translation files changes
type PassportElementErrorSourceTranslationFiles struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementErrorSourceTranslationFiles) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementErrorSourceTranslationFiles
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceTranslationFiles) GetClass() string {
return ClassPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceTranslationFiles) GetType() string {
return TypePassportElementErrorSourceTranslationFiles
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceTranslationFiles) PassportElementErrorSourceType() string {
return TypePassportElementErrorSourceTranslationFiles
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The file contains an error. The error will be considered resolved when the file changes
type PassportElementErrorSourceFile struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Index of a file with the error
FileIndex int32 `json:"file_index"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementErrorSourceFile) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementErrorSourceFile
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceFile) GetClass() string {
return ClassPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceFile) GetType() string {
return TypePassportElementErrorSourceFile
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceFile) PassportElementErrorSourceType() string {
return TypePassportElementErrorSourceFile
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The list of attached files contains an error. The error will be considered resolved when the list of files changes
type PassportElementErrorSourceFiles struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementErrorSourceFiles) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementErrorSourceFiles
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceFiles) GetClass() string {
return ClassPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceFiles) GetType() string {
return TypePassportElementErrorSourceFiles
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementErrorSourceFiles) PassportElementErrorSourceType() string {
return TypePassportElementErrorSourceFiles
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains the description of an error in a Telegram Passport element
type PassportElementError struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Type of the Telegram Passport element which has the error
Type PassportElementType `json:"type"`
// Error message
Message string `json:"message"`
// Error source
Source PassportElementErrorSource `json:"source"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementError) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementError
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementError) GetClass() string {
return ClassPassportElementError
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementError) GetType() string {
return TypePassportElementError
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (passportElementError *PassportElementError) UnmarshalJSON(data []byte) error {
var tmp struct {
Type json.RawMessage `json:"type"`
Message string `json:"message"`
Source json.RawMessage `json:"source"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
passportElementError.Message = tmp.Message
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldType, _ := UnmarshalPassportElementType(tmp.Type)
passportElementError.Type = fieldType
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldSource, _ := UnmarshalPassportElementErrorSource(tmp.Source)
passportElementError.Source = fieldSource
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about a Telegram Passport element that was requested by a service
type PassportSuitableElement struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Type of the element
Type PassportElementType `json:"type"`
// True, if a selfie is required with the identity document
IsSelfieRequired bool `json:"is_selfie_required"`
// True, if a certified English translation is required with the document
IsTranslationRequired bool `json:"is_translation_required"`
// True, if personal details must include the user's name in the language of their country of residence
IsNativeNameRequired bool `json:"is_native_name_required"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportSuitableElement) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportSuitableElement
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportSuitableElement) GetClass() string {
return ClassPassportSuitableElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportSuitableElement) GetType() string {
return TypePassportSuitableElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (passportSuitableElement *PassportSuitableElement) UnmarshalJSON(data []byte) error {
var tmp struct {
Type json.RawMessage `json:"type"`
IsSelfieRequired bool `json:"is_selfie_required"`
IsTranslationRequired bool `json:"is_translation_required"`
IsNativeNameRequired bool `json:"is_native_name_required"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
passportSuitableElement.IsSelfieRequired = tmp.IsSelfieRequired
passportSuitableElement.IsTranslationRequired = tmp.IsTranslationRequired
passportSuitableElement.IsNativeNameRequired = tmp.IsNativeNameRequired
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldType, _ := UnmarshalPassportElementType(tmp.Type)
passportSuitableElement.Type = fieldType
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains a description of the required Telegram Passport element that was requested by a service
type PassportRequiredElement struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of Telegram Passport elements any of which is enough to provide
SuitableElements []*PassportSuitableElement `json:"suitable_elements"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportRequiredElement) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportRequiredElement
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportRequiredElement) GetClass() string {
return ClassPassportRequiredElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportRequiredElement) GetType() string {
return TypePassportRequiredElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about a Telegram Passport authorization form that was requested
type PassportAuthorizationForm struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Unique identifier of the authorization form
Id int32 `json:"id"`
// Telegram Passport elements that must be provided to complete the form
RequiredElements []*PassportRequiredElement `json:"required_elements"`
// URL for the privacy policy of the service; may be empty
PrivacyPolicyUrl string `json:"privacy_policy_url"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportAuthorizationForm) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportAuthorizationForm
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportAuthorizationForm) GetClass() string {
return ClassPassportAuthorizationForm
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportAuthorizationForm) GetType() string {
return TypePassportAuthorizationForm
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about a Telegram Passport elements and corresponding errors
type PassportElementsWithErrors struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Telegram Passport elements
Elements []PassportElement `json:"elements"`
// Errors in the elements that are already available
Errors []*PassportElementError `json:"errors"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *PassportElementsWithErrors) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub PassportElementsWithErrors
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*PassportElementsWithErrors) GetClass() string {
return ClassPassportElementsWithErrors
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*PassportElementsWithErrors) GetType() string {
return TypePassportElementsWithErrors
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (passportElementsWithErrors *PassportElementsWithErrors) UnmarshalJSON(data []byte) error {
var tmp struct {
Elements []json.RawMessage `json:"elements"`
Errors []*PassportElementError `json:"errors"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
passportElementsWithErrors.Errors = tmp.Errors
fieldElements, _ := UnmarshalListOfPassportElement(tmp.Elements)
passportElementsWithErrors.Elements = fieldElements
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains encrypted Telegram Passport data credentials
type EncryptedCredentials struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The encrypted credentials
Data []byte `json:"data"`
// The decrypted data hash
Hash []byte `json:"hash"`
// Secret for data decryption, encrypted with the service's public key
Secret []byte `json:"secret"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *EncryptedCredentials) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub EncryptedCredentials
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*EncryptedCredentials) GetClass() string {
return ClassEncryptedCredentials
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*EncryptedCredentials) GetType() string {
return TypeEncryptedCredentials
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about an encrypted Telegram Passport element; for bots only
type EncryptedPassportElement struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Type of Telegram Passport element
Type PassportElementType `json:"type"`
// Encrypted JSON-encoded data about the user
Data []byte `json:"data"`
// The front side of an identity document
FrontSide *DatedFile `json:"front_side"`
// The reverse side of an identity document; may be null
ReverseSide *DatedFile `json:"reverse_side"`
// Selfie with the document; may be null
Selfie *DatedFile `json:"selfie"`
// List of files containing a certified English translation of the document
Translation []*DatedFile `json:"translation"`
// List of attached files
Files []*DatedFile `json:"files"`
// Unencrypted data, phone number or email address
Value string `json:"value"`
// Hash of the entire element
Hash string `json:"hash"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *EncryptedPassportElement) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub EncryptedPassportElement
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*EncryptedPassportElement) GetClass() string {
return ClassEncryptedPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*EncryptedPassportElement) GetType() string {
return TypeEncryptedPassportElement
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (encryptedPassportElement *EncryptedPassportElement) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
Type json.RawMessage `json:"type"`
Data []byte `json:"data"`
FrontSide *DatedFile `json:"front_side"`
ReverseSide *DatedFile `json:"reverse_side"`
Selfie *DatedFile `json:"selfie"`
Translation []*DatedFile `json:"translation"`
Files []*DatedFile `json:"files"`
Value string `json:"value"`
Hash string `json:"hash"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
encryptedPassportElement.Data = tmp.Data
encryptedPassportElement.FrontSide = tmp.FrontSide
encryptedPassportElement.ReverseSide = tmp.ReverseSide
encryptedPassportElement.Selfie = tmp.Selfie
encryptedPassportElement.Translation = tmp.Translation
encryptedPassportElement.Files = tmp.Files
encryptedPassportElement.Value = tmp.Value
encryptedPassportElement.Hash = tmp.Hash
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldType, _ := UnmarshalPassportElementType(tmp.Type)
encryptedPassportElement.Type = fieldType
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// The element contains an error in an unspecified place. The error will be considered resolved when new data is added
type InputPassportElementErrorSourceUnspecified struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Current hash of the entire element
ElementHash []byte `json:"element_hash"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementErrorSourceUnspecified) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementErrorSourceUnspecified
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceUnspecified) GetClass() string {
return ClassInputPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceUnspecified) GetType() string {
return TypeInputPassportElementErrorSourceUnspecified
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceUnspecified) InputPassportElementErrorSourceType() string {
return TypeInputPassportElementErrorSourceUnspecified
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A data field contains an error. The error is considered resolved when the field's value changes
type InputPassportElementErrorSourceDataField struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Field name
FieldName string `json:"field_name"`
// Current data hash
DataHash []byte `json:"data_hash"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementErrorSourceDataField) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementErrorSourceDataField
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceDataField) GetClass() string {
return ClassInputPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceDataField) GetType() string {
return TypeInputPassportElementErrorSourceDataField
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceDataField) InputPassportElementErrorSourceType() string {
return TypeInputPassportElementErrorSourceDataField
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The front side of the document contains an error. The error is considered resolved when the file with the front side of the document changes
type InputPassportElementErrorSourceFrontSide struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Current hash of the file containing the front side
FileHash []byte `json:"file_hash"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementErrorSourceFrontSide) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementErrorSourceFrontSide
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceFrontSide) GetClass() string {
return ClassInputPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceFrontSide) GetType() string {
return TypeInputPassportElementErrorSourceFrontSide
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceFrontSide) InputPassportElementErrorSourceType() string {
return TypeInputPassportElementErrorSourceFrontSide
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The reverse side of the document contains an error. The error is considered resolved when the file with the reverse side of the document changes
type InputPassportElementErrorSourceReverseSide struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Current hash of the file containing the reverse side
FileHash []byte `json:"file_hash"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementErrorSourceReverseSide) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementErrorSourceReverseSide
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceReverseSide) GetClass() string {
return ClassInputPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceReverseSide) GetType() string {
return TypeInputPassportElementErrorSourceReverseSide
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceReverseSide) InputPassportElementErrorSourceType() string {
return TypeInputPassportElementErrorSourceReverseSide
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The selfie contains an error. The error is considered resolved when the file with the selfie changes
type InputPassportElementErrorSourceSelfie struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Current hash of the file containing the selfie
FileHash []byte `json:"file_hash"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementErrorSourceSelfie) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementErrorSourceSelfie
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceSelfie) GetClass() string {
return ClassInputPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceSelfie) GetType() string {
return TypeInputPassportElementErrorSourceSelfie
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceSelfie) InputPassportElementErrorSourceType() string {
return TypeInputPassportElementErrorSourceSelfie
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// One of the files containing the translation of the document contains an error. The error is considered resolved when the file with the translation changes
type InputPassportElementErrorSourceTranslationFile struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Current hash of the file containing the translation
FileHash []byte `json:"file_hash"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementErrorSourceTranslationFile) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementErrorSourceTranslationFile
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceTranslationFile) GetClass() string {
return ClassInputPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceTranslationFile) GetType() string {
return TypeInputPassportElementErrorSourceTranslationFile
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceTranslationFile) InputPassportElementErrorSourceType() string {
return TypeInputPassportElementErrorSourceTranslationFile
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The translation of the document contains an error. The error is considered resolved when the list of files changes
type InputPassportElementErrorSourceTranslationFiles struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Current hashes of all files with the translation
FileHashes [][]byte `json:"file_hashes"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementErrorSourceTranslationFiles) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementErrorSourceTranslationFiles
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceTranslationFiles) GetClass() string {
return ClassInputPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceTranslationFiles) GetType() string {
return TypeInputPassportElementErrorSourceTranslationFiles
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceTranslationFiles) InputPassportElementErrorSourceType() string {
return TypeInputPassportElementErrorSourceTranslationFiles
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The file contains an error. The error is considered resolved when the file changes
type InputPassportElementErrorSourceFile struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Current hash of the file which has the error
FileHash []byte `json:"file_hash"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementErrorSourceFile) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementErrorSourceFile
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceFile) GetClass() string {
return ClassInputPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceFile) GetType() string {
return TypeInputPassportElementErrorSourceFile
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceFile) InputPassportElementErrorSourceType() string {
return TypeInputPassportElementErrorSourceFile
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The list of attached files contains an error. The error is considered resolved when the file list changes
type InputPassportElementErrorSourceFiles struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Current hashes of all attached files
FileHashes [][]byte `json:"file_hashes"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementErrorSourceFiles) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementErrorSourceFiles
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceFiles) GetClass() string {
return ClassInputPassportElementErrorSource
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceFiles) GetType() string {
return TypeInputPassportElementErrorSourceFiles
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementErrorSourceFiles) InputPassportElementErrorSourceType() string {
return TypeInputPassportElementErrorSourceFiles
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains the description of an error in a Telegram Passport element; for bots only
type InputPassportElementError struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Type of Telegram Passport element that has the error
Type PassportElementType `json:"type"`
// Error message
Message string `json:"message"`
// Error source
Source InputPassportElementErrorSource `json:"source"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputPassportElementError) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputPassportElementError
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementError) GetClass() string {
return ClassInputPassportElementError
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputPassportElementError) GetType() string {
return TypeInputPassportElementError
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputPassportElementError *InputPassportElementError) UnmarshalJSON(data []byte) error {
var tmp struct {
Type json.RawMessage `json:"type"`
Message string `json:"message"`
Source json.RawMessage `json:"source"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputPassportElementError.Message = tmp.Message
fieldType, _ := UnmarshalPassportElementType(tmp.Type)
inputPassportElementError.Type = fieldType
fieldSource, _ := UnmarshalInputPassportElementErrorSource(tmp.Source)
inputPassportElementError.Source = fieldSource
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A text message
type MessageText struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Text of the message
Text *FormattedText `json:"text"`
// A preview of the web page that's mentioned in the text; may be null
WebPage *WebPage `json:"web_page"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageText) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageText
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageText) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageText) GetType() string {
return TypeMessageText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageText) MessageContentType() string {
return TypeMessageText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An animation message (GIF-style).
type MessageAnimation struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The animation description
Animation *Animation `json:"animation"`
// Animation caption
Caption *FormattedText `json:"caption"`
2023-06-04 22:58:07 +02:00
// True, if the animation preview must be covered by a spoiler animation
HasSpoiler bool `json:"has_spoiler"`
2021-12-08 10:23:00 +01:00
// True, if the animation thumbnail must be blurred and the animation must be shown only while tapped
IsSecret bool `json:"is_secret"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageAnimation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageAnimation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageAnimation) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageAnimation) GetType() string {
return TypeMessageAnimation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageAnimation) MessageContentType() string {
return TypeMessageAnimation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An audio message
type MessageAudio struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The audio description
Audio *Audio `json:"audio"`
// Audio caption
Caption *FormattedText `json:"caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageAudio) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageAudio
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageAudio) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageAudio) GetType() string {
return TypeMessageAudio
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageAudio) MessageContentType() string {
return TypeMessageAudio
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A document message (general file)
type MessageDocument struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The document description
Document *Document `json:"document"`
// Document caption
Caption *FormattedText `json:"caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageDocument) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageDocument
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageDocument) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageDocument) GetType() string {
return TypeMessageDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageDocument) MessageContentType() string {
return TypeMessageDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A photo message
type MessagePhoto struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The photo
2021-12-08 10:23:00 +01:00
Photo *Photo `json:"photo"`
// Photo caption
Caption *FormattedText `json:"caption"`
2023-06-04 22:58:07 +02:00
// True, if the photo preview must be covered by a spoiler animation
HasSpoiler bool `json:"has_spoiler"`
2021-12-08 10:23:00 +01:00
// True, if the photo must be blurred and must be shown only while tapped
IsSecret bool `json:"is_secret"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessagePhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessagePhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessagePhoto) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessagePhoto) GetType() string {
return TypeMessagePhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePhoto) MessageContentType() string {
return TypeMessagePhoto
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A self-destructed photo message
2021-12-08 10:23:00 +01:00
type MessageExpiredPhoto struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *MessageExpiredPhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageExpiredPhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageExpiredPhoto) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageExpiredPhoto) GetType() string {
return TypeMessageExpiredPhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageExpiredPhoto) MessageContentType() string {
return TypeMessageExpiredPhoto
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
// A sticker message
type MessageSticker struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The sticker description
Sticker *Sticker `json:"sticker"`
2023-06-04 22:58:07 +02:00
// True, if premium animation of the sticker must be played
IsPremium bool `json:"is_premium"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageSticker) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageSticker
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageSticker) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageSticker) GetType() string {
return TypeMessageSticker
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSticker) MessageContentType() string {
return TypeMessageSticker
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A video message
type MessageVideo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The video description
Video *Video `json:"video"`
// Video caption
Caption *FormattedText `json:"caption"`
2023-06-04 22:58:07 +02:00
// True, if the video preview must be covered by a spoiler animation
HasSpoiler bool `json:"has_spoiler"`
2021-12-08 10:23:00 +01:00
// True, if the video thumbnail must be blurred and the video must be shown only while tapped
IsSecret bool `json:"is_secret"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageVideo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageVideo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageVideo) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageVideo) GetType() string {
return TypeMessageVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageVideo) MessageContentType() string {
return TypeMessageVideo
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A self-destructed video message
2021-12-08 10:23:00 +01:00
type MessageExpiredVideo struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *MessageExpiredVideo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageExpiredVideo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageExpiredVideo) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageExpiredVideo) GetType() string {
return TypeMessageExpiredVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageExpiredVideo) MessageContentType() string {
return TypeMessageExpiredVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A video note message
type MessageVideoNote struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The video note description
VideoNote *VideoNote `json:"video_note"`
// True, if at least one of the recipients has viewed the video note
IsViewed bool `json:"is_viewed"`
// True, if the video note thumbnail must be blurred and the video note must be shown only while tapped
IsSecret bool `json:"is_secret"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageVideoNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageVideoNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoNote) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoNote) GetType() string {
return TypeMessageVideoNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoNote) MessageContentType() string {
return TypeMessageVideoNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A voice note message
type MessageVoiceNote struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The voice note description
VoiceNote *VoiceNote `json:"voice_note"`
// Voice note caption
Caption *FormattedText `json:"caption"`
// True, if at least one of the recipients has listened to the voice note
IsListened bool `json:"is_listened"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageVoiceNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageVoiceNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageVoiceNote) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageVoiceNote) GetType() string {
return TypeMessageVoiceNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageVoiceNote) MessageContentType() string {
return TypeMessageVoiceNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message with a location
type MessageLocation struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The location description
Location *Location `json:"location"`
// Time relative to the message send date, for which the location can be updated, in seconds
LivePeriod int32 `json:"live_period"`
// Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes
ExpiresIn int32 `json:"expires_in"`
// For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown
Heading int32 `json:"heading"`
2023-06-04 22:58:07 +02:00
// For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only to the message sender
2021-12-08 10:23:00 +01:00
ProximityAlertRadius int32 `json:"proximity_alert_radius"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageLocation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageLocation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageLocation) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageLocation) GetType() string {
return TypeMessageLocation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageLocation) MessageContentType() string {
return TypeMessageLocation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message with information about a venue
type MessageVenue struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The venue description
Venue *Venue `json:"venue"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageVenue) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageVenue
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageVenue) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageVenue) GetType() string {
return TypeMessageVenue
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageVenue) MessageContentType() string {
return TypeMessageVenue
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message with a user contact
type MessageContact struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The contact description
Contact *Contact `json:"contact"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageContact) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageContact
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageContact) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageContact) GetType() string {
return TypeMessageContact
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageContact) MessageContentType() string {
return TypeMessageContact
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message with an animated emoji
type MessageAnimatedEmoji struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The animated emoji
AnimatedEmoji *AnimatedEmoji `json:"animated_emoji"`
// The corresponding emoji
Emoji string `json:"emoji"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageAnimatedEmoji) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageAnimatedEmoji
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageAnimatedEmoji) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageAnimatedEmoji) GetType() string {
return TypeMessageAnimatedEmoji
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageAnimatedEmoji) MessageContentType() string {
return TypeMessageAnimatedEmoji
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A dice message. The dice value is randomly generated by the server
type MessageDice struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The animated stickers with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
InitialState DiceStickers `json:"initial_state"`
// The animated stickers with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
FinalState DiceStickers `json:"final_state"`
// Emoji on which the dice throw animation is based
Emoji string `json:"emoji"`
// The dice value. If the value is 0, the dice don't have final state yet
Value int32 `json:"value"`
// Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded
SuccessAnimationFrameNumber int32 `json:"success_animation_frame_number"`
}
func (entity *MessageDice) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageDice
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageDice) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageDice) GetType() string {
return TypeMessageDice
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageDice) MessageContentType() string {
return TypeMessageDice
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (messageDice *MessageDice) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
InitialState json.RawMessage `json:"initial_state"`
FinalState json.RawMessage `json:"final_state"`
Emoji string `json:"emoji"`
Value int32 `json:"value"`
SuccessAnimationFrameNumber int32 `json:"success_animation_frame_number"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
messageDice.Emoji = tmp.Emoji
messageDice.Value = tmp.Value
messageDice.SuccessAnimationFrameNumber = tmp.SuccessAnimationFrameNumber
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldInitialState, _ := UnmarshalDiceStickers(tmp.InitialState)
messageDice.InitialState = fieldInitialState
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldFinalState, _ := UnmarshalDiceStickers(tmp.FinalState)
messageDice.FinalState = fieldFinalState
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A message with a game
type MessageGame struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The game description
Game *Game `json:"game"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageGame) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageGame
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageGame) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassMessageContent
}
2021-12-08 10:23:00 +01:00
func (*MessageGame) GetType() string {
return TypeMessageGame
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageGame) MessageContentType() string {
return TypeMessageGame
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message with a poll
type MessagePoll struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The poll description
Poll *Poll `json:"poll"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessagePoll) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessagePoll
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessagePoll) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePoll) GetType() string {
return TypeMessagePoll
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePoll) MessageContentType() string {
return TypeMessagePoll
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message with an invoice from a bot
type MessageInvoice struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Product title
Title string `json:"title"`
// Product description
2023-06-04 22:58:07 +02:00
Description *FormattedText `json:"description"`
2021-12-08 10:23:00 +01:00
// Product photo; may be null
Photo *Photo `json:"photo"`
// Currency for the product price
Currency string `json:"currency"`
// Product total price in the smallest units of the currency
TotalAmount int64 `json:"total_amount"`
// Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter}
StartParameter string `json:"start_parameter"`
// True, if the invoice is a test invoice
IsTest bool `json:"is_test"`
// True, if the shipping address must be specified
NeedShippingAddress bool `json:"need_shipping_address"`
// The identifier of the message with the receipt, after the product has been purchased
ReceiptMessageId int64 `json:"receipt_message_id"`
2023-06-04 22:58:07 +02:00
// Extended media attached to the invoice; may be null
ExtendedMedia MessageExtendedMedia `json:"extended_media"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageInvoice) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageInvoice
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageInvoice) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageInvoice) GetType() string {
return TypeMessageInvoice
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageInvoice) MessageContentType() string {
return TypeMessageInvoice
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (messageInvoice *MessageInvoice) UnmarshalJSON(data []byte) error {
var tmp struct {
Title string `json:"title"`
Description *FormattedText `json:"description"`
Photo *Photo `json:"photo"`
Currency string `json:"currency"`
TotalAmount int64 `json:"total_amount"`
StartParameter string `json:"start_parameter"`
IsTest bool `json:"is_test"`
NeedShippingAddress bool `json:"need_shipping_address"`
ReceiptMessageId int64 `json:"receipt_message_id"`
ExtendedMedia json.RawMessage `json:"extended_media"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
messageInvoice.Title = tmp.Title
messageInvoice.Description = tmp.Description
messageInvoice.Photo = tmp.Photo
messageInvoice.Currency = tmp.Currency
messageInvoice.TotalAmount = tmp.TotalAmount
messageInvoice.StartParameter = tmp.StartParameter
messageInvoice.IsTest = tmp.IsTest
messageInvoice.NeedShippingAddress = tmp.NeedShippingAddress
messageInvoice.ReceiptMessageId = tmp.ReceiptMessageId
fieldExtendedMedia, _ := UnmarshalMessageExtendedMedia(tmp.ExtendedMedia)
messageInvoice.ExtendedMedia = fieldExtendedMedia
return nil
}
2021-12-08 10:23:00 +01:00
// A message with information about an ended call
type MessageCall struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// True, if the call was a video call
IsVideo bool `json:"is_video"`
// Reason why the call was discarded
DiscardReason CallDiscardReason `json:"discard_reason"`
// Call duration, in seconds
Duration int32 `json:"duration"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageCall) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageCall
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageCall) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageCall) GetType() string {
return TypeMessageCall
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageCall) MessageContentType() string {
return TypeMessageCall
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (messageCall *MessageCall) UnmarshalJSON(data []byte) error {
var tmp struct {
IsVideo bool `json:"is_video"`
DiscardReason json.RawMessage `json:"discard_reason"`
Duration int32 `json:"duration"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
messageCall.IsVideo = tmp.IsVideo
messageCall.Duration = tmp.Duration
fieldDiscardReason, _ := UnmarshalCallDiscardReason(tmp.DiscardReason)
messageCall.DiscardReason = fieldDiscardReason
return nil
}
// A new video chat was scheduled
type MessageVideoChatScheduled struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the video chat. The video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
// Point in time (Unix timestamp) when the group call is supposed to be started by an administrator
StartDate int32 `json:"start_date"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageVideoChatScheduled) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageVideoChatScheduled
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoChatScheduled) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoChatScheduled) GetType() string {
return TypeMessageVideoChatScheduled
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoChatScheduled) MessageContentType() string {
return TypeMessageVideoChatScheduled
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A newly created video chat
type MessageVideoChatStarted struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the video chat. The video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageVideoChatStarted) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageVideoChatStarted
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoChatStarted) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoChatStarted) GetType() string {
return TypeMessageVideoChatStarted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoChatStarted) MessageContentType() string {
return TypeMessageVideoChatStarted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message with information about an ended video chat
type MessageVideoChatEnded struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Call duration, in seconds
Duration int32 `json:"duration"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageVideoChatEnded) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageVideoChatEnded
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoChatEnded) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoChatEnded) GetType() string {
return TypeMessageVideoChatEnded
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageVideoChatEnded) MessageContentType() string {
return TypeMessageVideoChatEnded
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message with information about an invite to a video chat
type MessageInviteVideoChatParticipants struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the video chat. The video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
// Invited user identifiers
UserIds []int64 `json:"user_ids"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageInviteVideoChatParticipants) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageInviteVideoChatParticipants
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageInviteVideoChatParticipants) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageInviteVideoChatParticipants) GetType() string {
return TypeMessageInviteVideoChatParticipants
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageInviteVideoChatParticipants) MessageContentType() string {
return TypeMessageInviteVideoChatParticipants
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A newly created basic group
type MessageBasicGroupChatCreate struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Title of the basic group
Title string `json:"title"`
// User identifiers of members in the basic group
MemberUserIds []int64 `json:"member_user_ids"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageBasicGroupChatCreate) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageBasicGroupChatCreate
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageBasicGroupChatCreate) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageBasicGroupChatCreate) GetType() string {
return TypeMessageBasicGroupChatCreate
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageBasicGroupChatCreate) MessageContentType() string {
return TypeMessageBasicGroupChatCreate
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A newly created supergroup or channel
type MessageSupergroupChatCreate struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Title of the supergroup or channel
Title string `json:"title"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageSupergroupChatCreate) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageSupergroupChatCreate
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageSupergroupChatCreate) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSupergroupChatCreate) GetType() string {
return TypeMessageSupergroupChatCreate
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSupergroupChatCreate) MessageContentType() string {
return TypeMessageSupergroupChatCreate
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
// An updated chat title
type MessageChatChangeTitle struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// New chat title
Title string `json:"title"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageChatChangeTitle) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageChatChangeTitle
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageChatChangeTitle) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatChangeTitle) GetType() string {
return TypeMessageChatChangeTitle
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatChangeTitle) MessageContentType() string {
return TypeMessageChatChangeTitle
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An updated chat photo
type MessageChatChangePhoto struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// New chat photo
Photo *ChatPhoto `json:"photo"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageChatChangePhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageChatChangePhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageChatChangePhoto) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatChangePhoto) GetType() string {
return TypeMessageChatChangePhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatChangePhoto) MessageContentType() string {
return TypeMessageChatChangePhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A deleted chat photo
type MessageChatDeletePhoto struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *MessageChatDeletePhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageChatDeletePhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageChatDeletePhoto) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatDeletePhoto) GetType() string {
return TypeMessageChatDeletePhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatDeletePhoto) MessageContentType() string {
return TypeMessageChatDeletePhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// New chat members were added
type MessageChatAddMembers struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// User identifiers of the new members
MemberUserIds []int64 `json:"member_user_ids"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageChatAddMembers) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageChatAddMembers
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageChatAddMembers) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatAddMembers) GetType() string {
return TypeMessageChatAddMembers
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatAddMembers) MessageContentType() string {
return TypeMessageChatAddMembers
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// A new member joined the chat via an invite link
2021-12-08 10:23:00 +01:00
type MessageChatJoinByLink struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *MessageChatJoinByLink) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageChatJoinByLink
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageChatJoinByLink) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatJoinByLink) GetType() string {
return TypeMessageChatJoinByLink
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatJoinByLink) MessageContentType() string {
return TypeMessageChatJoinByLink
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A new member was accepted to the chat by an administrator
type MessageChatJoinByRequest struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *MessageChatJoinByRequest) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageChatJoinByRequest
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageChatJoinByRequest) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatJoinByRequest) GetType() string {
return TypeMessageChatJoinByRequest
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatJoinByRequest) MessageContentType() string {
return TypeMessageChatJoinByRequest
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A chat member was deleted
type MessageChatDeleteMember struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// User identifier of the deleted chat member
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageChatDeleteMember) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageChatDeleteMember
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageChatDeleteMember) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatDeleteMember) GetType() string {
return TypeMessageChatDeleteMember
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatDeleteMember) MessageContentType() string {
return TypeMessageChatDeleteMember
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A basic group was upgraded to a supergroup and was deactivated as the result
type MessageChatUpgradeTo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the supergroup to which the basic group was upgraded
SupergroupId int64 `json:"supergroup_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageChatUpgradeTo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageChatUpgradeTo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageChatUpgradeTo) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatUpgradeTo) GetType() string {
return TypeMessageChatUpgradeTo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatUpgradeTo) MessageContentType() string {
return TypeMessageChatUpgradeTo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A supergroup has been created from a basic group
type MessageChatUpgradeFrom struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Title of the newly created supergroup
Title string `json:"title"`
// The identifier of the original basic group
BasicGroupId int64 `json:"basic_group_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageChatUpgradeFrom) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageChatUpgradeFrom
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageChatUpgradeFrom) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatUpgradeFrom) GetType() string {
return TypeMessageChatUpgradeFrom
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatUpgradeFrom) MessageContentType() string {
return TypeMessageChatUpgradeFrom
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message has been pinned
type MessagePinMessage struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the pinned message, can be an identifier of a deleted message or 0
MessageId int64 `json:"message_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessagePinMessage) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessagePinMessage
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessagePinMessage) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePinMessage) GetType() string {
return TypeMessagePinMessage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePinMessage) MessageContentType() string {
return TypeMessagePinMessage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A screenshot of a message in the chat has been taken
type MessageScreenshotTaken struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *MessageScreenshotTaken) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageScreenshotTaken
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageScreenshotTaken) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageScreenshotTaken) GetType() string {
return TypeMessageScreenshotTaken
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageScreenshotTaken) MessageContentType() string {
return TypeMessageScreenshotTaken
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
// A theme in the chat has been changed
type MessageChatSetTheme struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one
ThemeName string `json:"theme_name"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageChatSetTheme) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageChatSetTheme
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageChatSetTheme) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatSetTheme) GetType() string {
return TypeMessageChatSetTheme
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageChatSetTheme) MessageContentType() string {
return TypeMessageChatSetTheme
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The auto-delete or self-destruct timer for messages in the chat has been changed
type MessageChatSetMessageAutoDeleteTime struct {
meta
// New value auto-delete or self-destruct time, in seconds; 0 if disabled
MessageAutoDeleteTime int32 `json:"message_auto_delete_time"`
// If not 0, a user identifier, which default setting was automatically applied
FromUserId int64 `json:"from_user_id"`
}
func (entity *MessageChatSetMessageAutoDeleteTime) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageChatSetMessageAutoDeleteTime
return json.Marshal((*stub)(entity))
}
func (*MessageChatSetMessageAutoDeleteTime) GetClass() string {
return ClassMessageContent
}
func (*MessageChatSetMessageAutoDeleteTime) GetType() string {
return TypeMessageChatSetMessageAutoDeleteTime
}
func (*MessageChatSetMessageAutoDeleteTime) MessageContentType() string {
return TypeMessageChatSetMessageAutoDeleteTime
}
// A forum topic has been created
type MessageForumTopicCreated struct {
meta
// Name of the topic
Name string `json:"name"`
// Icon of the topic
Icon *ForumTopicIcon `json:"icon"`
}
func (entity *MessageForumTopicCreated) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageForumTopicCreated
return json.Marshal((*stub)(entity))
}
func (*MessageForumTopicCreated) GetClass() string {
return ClassMessageContent
}
func (*MessageForumTopicCreated) GetType() string {
return TypeMessageForumTopicCreated
}
func (*MessageForumTopicCreated) MessageContentType() string {
return TypeMessageForumTopicCreated
}
// A forum topic has been edited
type MessageForumTopicEdited struct {
meta
// If non-empty, the new name of the topic
Name string `json:"name"`
// True, if icon's custom_emoji_id is changed
EditIconCustomEmojiId bool `json:"edit_icon_custom_emoji_id"`
// New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false
IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"`
}
func (entity *MessageForumTopicEdited) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageForumTopicEdited
return json.Marshal((*stub)(entity))
}
func (*MessageForumTopicEdited) GetClass() string {
return ClassMessageContent
}
func (*MessageForumTopicEdited) GetType() string {
return TypeMessageForumTopicEdited
}
func (*MessageForumTopicEdited) MessageContentType() string {
return TypeMessageForumTopicEdited
}
// A forum topic has been closed or opened
type MessageForumTopicIsClosedToggled struct {
meta
// True, if the topic was closed, otherwise the topic was reopened
IsClosed bool `json:"is_closed"`
}
func (entity *MessageForumTopicIsClosedToggled) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageForumTopicIsClosedToggled
return json.Marshal((*stub)(entity))
}
func (*MessageForumTopicIsClosedToggled) GetClass() string {
return ClassMessageContent
}
func (*MessageForumTopicIsClosedToggled) GetType() string {
return TypeMessageForumTopicIsClosedToggled
}
func (*MessageForumTopicIsClosedToggled) MessageContentType() string {
return TypeMessageForumTopicIsClosedToggled
}
// A General forum topic has been hidden or unhidden
type MessageForumTopicIsHiddenToggled struct {
meta
// True, if the topic was hidden, otherwise the topic was unhidden
IsHidden bool `json:"is_hidden"`
}
func (entity *MessageForumTopicIsHiddenToggled) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageForumTopicIsHiddenToggled
return json.Marshal((*stub)(entity))
}
func (*MessageForumTopicIsHiddenToggled) GetClass() string {
return ClassMessageContent
}
func (*MessageForumTopicIsHiddenToggled) GetType() string {
return TypeMessageForumTopicIsHiddenToggled
}
func (*MessageForumTopicIsHiddenToggled) MessageContentType() string {
return TypeMessageForumTopicIsHiddenToggled
}
// A profile photo was suggested to a user in a private chat
type MessageSuggestProfilePhoto struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo
Photo *ChatPhoto `json:"photo"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *MessageSuggestProfilePhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub MessageSuggestProfilePhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*MessageSuggestProfilePhoto) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*MessageSuggestProfilePhoto) GetType() string {
return TypeMessageSuggestProfilePhoto
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*MessageSuggestProfilePhoto) MessageContentType() string {
return TypeMessageSuggestProfilePhoto
2021-12-08 10:23:00 +01:00
}
// A non-standard action has happened in the chat
type MessageCustomServiceAction struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Message text to be shown in the chat
Text string `json:"text"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageCustomServiceAction) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageCustomServiceAction
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageCustomServiceAction) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageCustomServiceAction) GetType() string {
return TypeMessageCustomServiceAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageCustomServiceAction) MessageContentType() string {
return TypeMessageCustomServiceAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A new high score was achieved in a game
type MessageGameScore struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the message with the game, can be an identifier of a deleted message
GameMessageId int64 `json:"game_message_id"`
// Identifier of the game; may be different from the games presented in the message with the game
GameId JsonInt64 `json:"game_id"`
// New score
Score int32 `json:"score"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageGameScore) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageGameScore
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageGameScore) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageGameScore) GetType() string {
return TypeMessageGameScore
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageGameScore) MessageContentType() string {
return TypeMessageGameScore
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A payment has been completed
type MessagePaymentSuccessful struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Identifier of the chat, containing the corresponding invoice message
2021-12-08 10:23:00 +01:00
InvoiceChatId int64 `json:"invoice_chat_id"`
2023-06-04 22:58:07 +02:00
// Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message
2021-12-08 10:23:00 +01:00
InvoiceMessageId int64 `json:"invoice_message_id"`
// Currency for the price of the product
Currency string `json:"currency"`
// Total price for the product, in the smallest units of the currency
TotalAmount int64 `json:"total_amount"`
2023-06-04 22:58:07 +02:00
// True, if this is a recurring payment
IsRecurring bool `json:"is_recurring"`
// True, if this is the first recurring payment
IsFirstRecurring bool `json:"is_first_recurring"`
// Name of the invoice; may be empty if unknown
InvoiceName string `json:"invoice_name"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessagePaymentSuccessful) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessagePaymentSuccessful
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessagePaymentSuccessful) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePaymentSuccessful) GetType() string {
return TypeMessagePaymentSuccessful
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePaymentSuccessful) MessageContentType() string {
return TypeMessagePaymentSuccessful
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A payment has been completed; for bots only
type MessagePaymentSuccessfulBot struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Currency for price of the product
Currency string `json:"currency"`
// Total price for the product, in the smallest units of the currency
TotalAmount int64 `json:"total_amount"`
2023-06-04 22:58:07 +02:00
// True, if this is a recurring payment
IsRecurring bool `json:"is_recurring"`
// True, if this is the first recurring payment
IsFirstRecurring bool `json:"is_first_recurring"`
2021-12-08 10:23:00 +01:00
// Invoice payload
InvoicePayload []byte `json:"invoice_payload"`
// Identifier of the shipping option chosen by the user; may be empty if not applicable
ShippingOptionId string `json:"shipping_option_id"`
// Information about the order; may be null
OrderInfo *OrderInfo `json:"order_info"`
// Telegram payment identifier
TelegramPaymentChargeId string `json:"telegram_payment_charge_id"`
// Provider payment identifier
ProviderPaymentChargeId string `json:"provider_payment_charge_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessagePaymentSuccessfulBot) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessagePaymentSuccessfulBot
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessagePaymentSuccessfulBot) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePaymentSuccessfulBot) GetType() string {
return TypeMessagePaymentSuccessfulBot
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePaymentSuccessfulBot) MessageContentType() string {
return TypeMessagePaymentSuccessfulBot
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Telegram Premium was gifted to the user
type MessageGiftedPremium struct {
meta
// Currency for the paid amount
Currency string `json:"currency"`
// The paid amount, in the smallest units of the currency
Amount int64 `json:"amount"`
// Number of month the Telegram Premium subscription will be active
MonthCount int32 `json:"month_count"`
// A sticker to be shown in the message; may be null if unknown
Sticker *Sticker `json:"sticker"`
}
func (entity *MessageGiftedPremium) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageGiftedPremium
return json.Marshal((*stub)(entity))
}
func (*MessageGiftedPremium) GetClass() string {
return ClassMessageContent
}
func (*MessageGiftedPremium) GetType() string {
return TypeMessageGiftedPremium
}
func (*MessageGiftedPremium) MessageContentType() string {
return TypeMessageGiftedPremium
}
2021-12-08 10:23:00 +01:00
// A contact has registered with Telegram
type MessageContactRegistered struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *MessageContactRegistered) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageContactRegistered
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageContactRegistered) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageContactRegistered) GetType() string {
return TypeMessageContactRegistered
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageContactRegistered) MessageContentType() string {
return TypeMessageContactRegistered
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The current user has connected a website by logging in using Telegram Login Widget on it
type MessageWebsiteConnected struct {
meta
// Domain name of the connected website
DomainName string `json:"domain_name"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *MessageWebsiteConnected) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub MessageWebsiteConnected
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*MessageWebsiteConnected) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageWebsiteConnected) GetType() string {
return TypeMessageWebsiteConnected
}
func (*MessageWebsiteConnected) MessageContentType() string {
return TypeMessageWebsiteConnected
}
2023-06-04 22:58:07 +02:00
// The user allowed the bot to send messages
type MessageBotWriteAccessAllowed struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *MessageBotWriteAccessAllowed) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub MessageBotWriteAccessAllowed
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*MessageBotWriteAccessAllowed) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*MessageBotWriteAccessAllowed) GetType() string {
return TypeMessageBotWriteAccessAllowed
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*MessageBotWriteAccessAllowed) MessageContentType() string {
return TypeMessageBotWriteAccessAllowed
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Data from a Web App has been sent to a bot
type MessageWebAppDataSent struct {
meta
// Text of the keyboardButtonTypeWebApp button, which opened the Web App
ButtonText string `json:"button_text"`
}
func (entity *MessageWebAppDataSent) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageWebAppDataSent
return json.Marshal((*stub)(entity))
}
func (*MessageWebAppDataSent) GetClass() string {
return ClassMessageContent
}
func (*MessageWebAppDataSent) GetType() string {
return TypeMessageWebAppDataSent
}
func (*MessageWebAppDataSent) MessageContentType() string {
return TypeMessageWebAppDataSent
}
// Data from a Web App has been received; for bots only
type MessageWebAppDataReceived struct {
meta
// Text of the keyboardButtonTypeWebApp button, which opened the Web App
ButtonText string `json:"button_text"`
// Received data
Data string `json:"data"`
}
func (entity *MessageWebAppDataReceived) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageWebAppDataReceived
return json.Marshal((*stub)(entity))
}
func (*MessageWebAppDataReceived) GetClass() string {
return ClassMessageContent
}
func (*MessageWebAppDataReceived) GetType() string {
return TypeMessageWebAppDataReceived
}
func (*MessageWebAppDataReceived) MessageContentType() string {
return TypeMessageWebAppDataReceived
}
// Telegram Passport data has been sent to a bot
type MessagePassportDataSent struct {
meta
// List of Telegram Passport element types sent
Types []PassportElementType `json:"types"`
}
func (entity *MessagePassportDataSent) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessagePassportDataSent
return json.Marshal((*stub)(entity))
}
func (*MessagePassportDataSent) GetClass() string {
return ClassMessageContent
}
func (*MessagePassportDataSent) GetType() string {
return TypeMessagePassportDataSent
}
func (*MessagePassportDataSent) MessageContentType() string {
return TypeMessagePassportDataSent
}
func (messagePassportDataSent *MessagePassportDataSent) UnmarshalJSON(data []byte) error {
var tmp struct {
Types []json.RawMessage `json:"types"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
fieldTypes, _ := UnmarshalListOfPassportElementType(tmp.Types)
messagePassportDataSent.Types = fieldTypes
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// Telegram Passport data has been received; for bots only
type MessagePassportDataReceived struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of received Telegram Passport elements
Elements []*EncryptedPassportElement `json:"elements"`
// Encrypted data credentials
Credentials *EncryptedCredentials `json:"credentials"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessagePassportDataReceived) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessagePassportDataReceived
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessagePassportDataReceived) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePassportDataReceived) GetType() string {
return TypeMessagePassportDataReceived
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessagePassportDataReceived) MessageContentType() string {
return TypeMessagePassportDataReceived
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A user in the chat came within proximity alert range
type MessageProximityAlertTriggered struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The identifier of a user or chat that triggered the proximity alert
TravelerId MessageSender `json:"traveler_id"`
// The identifier of a user or chat that subscribed for the proximity alert
WatcherId MessageSender `json:"watcher_id"`
// The distance between the users
Distance int32 `json:"distance"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageProximityAlertTriggered) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageProximityAlertTriggered
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageProximityAlertTriggered) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageProximityAlertTriggered) GetType() string {
return TypeMessageProximityAlertTriggered
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageProximityAlertTriggered) MessageContentType() string {
return TypeMessageProximityAlertTriggered
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (messageProximityAlertTriggered *MessageProximityAlertTriggered) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
TravelerId json.RawMessage `json:"traveler_id"`
WatcherId json.RawMessage `json:"watcher_id"`
Distance int32 `json:"distance"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
messageProximityAlertTriggered.Distance = tmp.Distance
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldTravelerId, _ := UnmarshalMessageSender(tmp.TravelerId)
messageProximityAlertTriggered.TravelerId = fieldTravelerId
fieldWatcherId, _ := UnmarshalMessageSender(tmp.WatcherId)
messageProximityAlertTriggered.WatcherId = fieldWatcherId
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// Message content that is not supported in the current TDLib version
type MessageUnsupported struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *MessageUnsupported) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageUnsupported
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageUnsupported) GetClass() string {
return ClassMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageUnsupported) GetType() string {
return TypeMessageUnsupported
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageUnsupported) MessageContentType() string {
return TypeMessageUnsupported
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A mention of a user, a supergroup, or a channel by their username
2021-12-08 10:23:00 +01:00
type TextEntityTypeMention struct {
meta
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeMention) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeMention
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeMention) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeMention) GetType() string {
return TypeTextEntityTypeMention
}
func (*TextEntityTypeMention) TextEntityTypeType() string {
return TypeTextEntityTypeMention
}
// A hashtag text, beginning with "#"
type TextEntityTypeHashtag struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeHashtag) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeHashtag
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeHashtag) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeHashtag) GetType() string {
return TypeTextEntityTypeHashtag
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeHashtag) TextEntityTypeType() string {
return TypeTextEntityTypeHashtag
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A cashtag text, beginning with "$" and consisting of capital English letters (e.g., "$USD")
type TextEntityTypeCashtag struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeCashtag) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeCashtag
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeCashtag) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeCashtag) GetType() string {
return TypeTextEntityTypeCashtag
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeCashtag) TextEntityTypeType() string {
return TypeTextEntityTypeCashtag
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A bot command, beginning with "/"
type TextEntityTypeBotCommand struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeBotCommand) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeBotCommand
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeBotCommand) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeBotCommand) GetType() string {
return TypeTextEntityTypeBotCommand
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeBotCommand) TextEntityTypeType() string {
return TypeTextEntityTypeBotCommand
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An HTTP URL
type TextEntityTypeUrl struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeUrl) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeUrl
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeUrl) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeUrl) GetType() string {
return TypeTextEntityTypeUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeUrl) TextEntityTypeType() string {
return TypeTextEntityTypeUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An email address
type TextEntityTypeEmailAddress struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeEmailAddress) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeEmailAddress
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeEmailAddress) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeEmailAddress) GetType() string {
return TypeTextEntityTypeEmailAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeEmailAddress) TextEntityTypeType() string {
return TypeTextEntityTypeEmailAddress
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A phone number
type TextEntityTypePhoneNumber struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypePhoneNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypePhoneNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypePhoneNumber) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypePhoneNumber) GetType() string {
return TypeTextEntityTypePhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypePhoneNumber) TextEntityTypeType() string {
return TypeTextEntityTypePhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A bank card number. The getBankCardInfo method can be used to get information about the bank card
type TextEntityTypeBankCardNumber struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeBankCardNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeBankCardNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeBankCardNumber) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeBankCardNumber) GetType() string {
return TypeTextEntityTypeBankCardNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeBankCardNumber) TextEntityTypeType() string {
return TypeTextEntityTypeBankCardNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A bold text
type TextEntityTypeBold struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeBold) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeBold
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeBold) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeBold) GetType() string {
return TypeTextEntityTypeBold
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeBold) TextEntityTypeType() string {
return TypeTextEntityTypeBold
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An italic text
type TextEntityTypeItalic struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeItalic) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeItalic
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeItalic) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeItalic) GetType() string {
return TypeTextEntityTypeItalic
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeItalic) TextEntityTypeType() string {
return TypeTextEntityTypeItalic
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An underlined text
type TextEntityTypeUnderline struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeUnderline) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeUnderline
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeUnderline) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeUnderline) GetType() string {
return TypeTextEntityTypeUnderline
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeUnderline) TextEntityTypeType() string {
return TypeTextEntityTypeUnderline
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A strikethrough text
type TextEntityTypeStrikethrough struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeStrikethrough) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeStrikethrough
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeStrikethrough) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeStrikethrough) GetType() string {
return TypeTextEntityTypeStrikethrough
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeStrikethrough) TextEntityTypeType() string {
return TypeTextEntityTypeStrikethrough
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A spoiler text
type TextEntityTypeSpoiler struct {
meta
}
func (entity *TextEntityTypeSpoiler) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TextEntityTypeSpoiler
return json.Marshal((*stub)(entity))
}
func (*TextEntityTypeSpoiler) GetClass() string {
return ClassTextEntityType
}
func (*TextEntityTypeSpoiler) GetType() string {
return TypeTextEntityTypeSpoiler
}
func (*TextEntityTypeSpoiler) TextEntityTypeType() string {
return TypeTextEntityTypeSpoiler
}
2021-12-08 10:23:00 +01:00
// Text that must be formatted as if inside a code HTML tag
type TextEntityTypeCode struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeCode) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeCode
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeCode) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeCode) GetType() string {
return TypeTextEntityTypeCode
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeCode) TextEntityTypeType() string {
return TypeTextEntityTypeCode
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Text that must be formatted as if inside a pre HTML tag
type TextEntityTypePre struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypePre) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypePre
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypePre) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypePre) GetType() string {
return TypeTextEntityTypePre
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypePre) TextEntityTypeType() string {
return TypeTextEntityTypePre
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Text that must be formatted as if inside pre, and code HTML tags
type TextEntityTypePreCode struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Programming language of the code; as defined by the sender
Language string `json:"language"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypePreCode) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypePreCode
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypePreCode) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypePreCode) GetType() string {
return TypeTextEntityTypePreCode
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypePreCode) TextEntityTypeType() string {
return TypeTextEntityTypePreCode
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A text description shown instead of a raw URL
type TextEntityTypeTextUrl struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// HTTP or tg:// URL to be opened when the link is clicked
Url string `json:"url"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeTextUrl) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeTextUrl
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeTextUrl) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeTextUrl) GetType() string {
return TypeTextEntityTypeTextUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeTextUrl) TextEntityTypeType() string {
return TypeTextEntityTypeTextUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A text shows instead of a raw mention of the user (e.g., when the user has no username)
type TextEntityTypeMentionName struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the mentioned user
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeMentionName) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeMentionName
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeMentionName) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeMentionName) GetType() string {
return TypeTextEntityTypeMentionName
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeMentionName) TextEntityTypeType() string {
return TypeTextEntityTypeMentionName
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji
type TextEntityTypeCustomEmoji struct {
meta
// Unique identifier of the custom emoji
CustomEmojiId JsonInt64 `json:"custom_emoji_id"`
}
func (entity *TextEntityTypeCustomEmoji) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TextEntityTypeCustomEmoji
return json.Marshal((*stub)(entity))
}
func (*TextEntityTypeCustomEmoji) GetClass() string {
return ClassTextEntityType
}
func (*TextEntityTypeCustomEmoji) GetType() string {
return TypeTextEntityTypeCustomEmoji
}
func (*TextEntityTypeCustomEmoji) TextEntityTypeType() string {
return TypeTextEntityTypeCustomEmoji
}
2021-12-08 10:23:00 +01:00
// A media timestamp
type TextEntityTypeMediaTimestamp struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message
MediaTimestamp int32 `json:"media_timestamp"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *TextEntityTypeMediaTimestamp) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub TextEntityTypeMediaTimestamp
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeMediaTimestamp) GetClass() string {
return ClassTextEntityType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeMediaTimestamp) GetType() string {
return TypeTextEntityTypeMediaTimestamp
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*TextEntityTypeMediaTimestamp) TextEntityTypeType() string {
return TypeTextEntityTypeMediaTimestamp
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// 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 {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Thumbnail file to send. Sending thumbnails by file_id is currently not supported
Thumbnail InputFile `json:"thumbnail"`
// Thumbnail width, usually shouldn't exceed 320. Use 0 if unknown
Width int32 `json:"width"`
// Thumbnail height, usually shouldn't exceed 320. Use 0 if unknown
Height int32 `json:"height"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputThumbnail) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputThumbnail
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputThumbnail) GetClass() string {
return ClassInputThumbnail
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputThumbnail) GetType() string {
return TypeInputThumbnail
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputThumbnail *InputThumbnail) UnmarshalJSON(data []byte) error {
var tmp struct {
Thumbnail json.RawMessage `json:"thumbnail"`
Width int32 `json:"width"`
Height int32 `json:"height"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
inputThumbnail.Width = tmp.Width
inputThumbnail.Height = tmp.Height
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldThumbnail, _ := UnmarshalInputFile(tmp.Thumbnail)
inputThumbnail.Thumbnail = fieldThumbnail
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The message will be sent at the specified date
type MessageSchedulingStateSendAtDate struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Date the message will be sent. The date must be within 367 days in the future
SendDate int32 `json:"send_date"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageSchedulingStateSendAtDate) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageSchedulingStateSendAtDate
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageSchedulingStateSendAtDate) GetClass() string {
return ClassMessageSchedulingState
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSchedulingStateSendAtDate) GetType() string {
return TypeMessageSchedulingStateSendAtDate
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSchedulingStateSendAtDate) MessageSchedulingStateType() string {
return TypeMessageSchedulingStateSendAtDate
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known
type MessageSchedulingStateSendWhenOnline struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *MessageSchedulingStateSendWhenOnline) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageSchedulingStateSendWhenOnline
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageSchedulingStateSendWhenOnline) GetClass() string {
return ClassMessageSchedulingState
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSchedulingStateSendWhenOnline) GetType() string {
return TypeMessageSchedulingStateSendWhenOnline
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSchedulingStateSendWhenOnline) MessageSchedulingStateType() string {
return TypeMessageSchedulingStateSendWhenOnline
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Options to be used when a message is sent
type MessageSendOptions struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Pass true to disable notification for the message
DisableNotification bool `json:"disable_notification"`
// Pass true if the message is sent from the background
FromBackground bool `json:"from_background"`
2023-06-04 22:58:07 +02:00
// 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 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"`
2021-12-08 10:23:00 +01:00
// 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
SchedulingState MessageSchedulingState `json:"scheduling_state"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageSendOptions) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageSendOptions
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageSendOptions) GetClass() string {
return ClassMessageSendOptions
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageSendOptions) GetType() string {
return TypeMessageSendOptions
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error {
var tmp struct {
2023-06-04 22:58:07 +02:00
DisableNotification bool `json:"disable_notification"`
FromBackground bool `json:"from_background"`
ProtectContent bool `json:"protect_content"`
UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"`
SchedulingState json.RawMessage `json:"scheduling_state"`
2021-12-08 10:23:00 +01:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
messageSendOptions.DisableNotification = tmp.DisableNotification
messageSendOptions.FromBackground = tmp.FromBackground
2023-06-04 22:58:07 +02:00
messageSendOptions.ProtectContent = tmp.ProtectContent
messageSendOptions.UpdateOrderOfInstalledStickerSets = tmp.UpdateOrderOfInstalledStickerSets
2021-12-08 10:23:00 +01:00
fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState)
messageSendOptions.SchedulingState = fieldSchedulingState
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied
type MessageCopyOptions struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// 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
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"`
// New message caption; pass null to copy message without caption. Ignored if replace_caption is false
NewCaption *FormattedText `json:"new_caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *MessageCopyOptions) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub MessageCopyOptions
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*MessageCopyOptions) GetClass() string {
return ClassMessageCopyOptions
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*MessageCopyOptions) GetType() string {
return TypeMessageCopyOptions
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A text message
type InputMessageText struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually
2021-12-08 10:23:00 +01:00
Text *FormattedText `json:"text"`
// True, if rich web page previews for URLs in the message text must be disabled
DisableWebPagePreview bool `json:"disable_web_page_preview"`
// True, if a chat message draft must be deleted
ClearDraft bool `json:"clear_draft"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageText) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageText
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageText) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageText) GetType() string {
return TypeInputMessageText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageText) InputMessageContentType() string {
return TypeInputMessageText
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An animation message (GIF-style).
type InputMessageAnimation struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Animation file to be sent
Animation InputFile `json:"animation"`
// Animation thumbnail; pass null to skip thumbnail uploading
Thumbnail *InputThumbnail `json:"thumbnail"`
// File identifiers of the stickers added to the animation, if applicable
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
// Duration of the animation, in seconds
Duration int32 `json:"duration"`
// Width of the animation; may be replaced by the server
Width int32 `json:"width"`
// Height of the animation; may be replaced by the server
Height int32 `json:"height"`
2023-06-04 22:58:07 +02:00
// Animation caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
2021-12-08 10:23:00 +01:00
Caption *FormattedText `json:"caption"`
2023-06-04 22:58:07 +02:00
// True, if the animation preview must be covered by a spoiler animation; not supported in secret chats
HasSpoiler bool `json:"has_spoiler"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageAnimation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageAnimation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageAnimation) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageAnimation) GetType() string {
return TypeInputMessageAnimation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageAnimation) InputMessageContentType() string {
return TypeInputMessageAnimation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputMessageAnimation *InputMessageAnimation) UnmarshalJSON(data []byte) error {
var tmp struct {
Animation json.RawMessage `json:"animation"`
Thumbnail *InputThumbnail `json:"thumbnail"`
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
Duration int32 `json:"duration"`
Width int32 `json:"width"`
Height int32 `json:"height"`
Caption *FormattedText `json:"caption"`
2023-06-04 22:58:07 +02:00
HasSpoiler bool `json:"has_spoiler"`
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
inputMessageAnimation.Thumbnail = tmp.Thumbnail
inputMessageAnimation.AddedStickerFileIds = tmp.AddedStickerFileIds
inputMessageAnimation.Duration = tmp.Duration
inputMessageAnimation.Width = tmp.Width
inputMessageAnimation.Height = tmp.Height
inputMessageAnimation.Caption = tmp.Caption
2023-06-04 22:58:07 +02:00
inputMessageAnimation.HasSpoiler = tmp.HasSpoiler
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldAnimation, _ := UnmarshalInputFile(tmp.Animation)
inputMessageAnimation.Animation = fieldAnimation
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// An audio message
type InputMessageAudio struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Audio file to be sent
Audio InputFile `json:"audio"`
// Thumbnail of the cover for the album; pass null to skip thumbnail uploading
AlbumCoverThumbnail *InputThumbnail `json:"album_cover_thumbnail"`
// Duration of the audio, in seconds; may be replaced by the server
Duration int32 `json:"duration"`
// Title of the audio; 0-64 characters; may be replaced by the server
Title string `json:"title"`
// Performer of the audio; 0-64 characters, may be replaced by the server
Performer string `json:"performer"`
2023-06-04 22:58:07 +02:00
// Audio caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
2021-12-08 10:23:00 +01:00
Caption *FormattedText `json:"caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageAudio) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageAudio
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageAudio) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageAudio) GetType() string {
return TypeInputMessageAudio
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageAudio) InputMessageContentType() string {
return TypeInputMessageAudio
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputMessageAudio *InputMessageAudio) UnmarshalJSON(data []byte) error {
var tmp struct {
Audio json.RawMessage `json:"audio"`
AlbumCoverThumbnail *InputThumbnail `json:"album_cover_thumbnail"`
Duration int32 `json:"duration"`
Title string `json:"title"`
Performer string `json:"performer"`
Caption *FormattedText `json:"caption"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
inputMessageAudio.AlbumCoverThumbnail = tmp.AlbumCoverThumbnail
inputMessageAudio.Duration = tmp.Duration
inputMessageAudio.Title = tmp.Title
inputMessageAudio.Performer = tmp.Performer
inputMessageAudio.Caption = tmp.Caption
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldAudio, _ := UnmarshalInputFile(tmp.Audio)
inputMessageAudio.Audio = fieldAudio
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A document message (general file)
type InputMessageDocument struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Document to be sent
Document InputFile `json:"document"`
// Document thumbnail; pass null to skip thumbnail uploading
Thumbnail *InputThumbnail `json:"thumbnail"`
2023-06-04 22:58:07 +02:00
// If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats
2021-12-08 10:23:00 +01:00
DisableContentTypeDetection bool `json:"disable_content_type_detection"`
2023-06-04 22:58:07 +02:00
// Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
2021-12-08 10:23:00 +01:00
Caption *FormattedText `json:"caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageDocument) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageDocument
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageDocument) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageDocument) GetType() string {
return TypeInputMessageDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageDocument) InputMessageContentType() string {
return TypeInputMessageDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputMessageDocument *InputMessageDocument) UnmarshalJSON(data []byte) error {
var tmp struct {
Document json.RawMessage `json:"document"`
Thumbnail *InputThumbnail `json:"thumbnail"`
DisableContentTypeDetection bool `json:"disable_content_type_detection"`
Caption *FormattedText `json:"caption"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
inputMessageDocument.Thumbnail = tmp.Thumbnail
inputMessageDocument.DisableContentTypeDetection = tmp.DisableContentTypeDetection
inputMessageDocument.Caption = tmp.Caption
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldDocument, _ := UnmarshalInputFile(tmp.Document)
inputMessageDocument.Document = fieldDocument
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A photo message
type InputMessagePhoto struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20
2021-12-08 10:23:00 +01:00
Photo InputFile `json:"photo"`
// Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats
Thumbnail *InputThumbnail `json:"thumbnail"`
// File identifiers of the stickers added to the photo, if applicable
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
// Photo width
Width int32 `json:"width"`
// Photo height
Height int32 `json:"height"`
2023-06-04 22:58:07 +02:00
// Photo caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
2021-12-08 10:23:00 +01:00
Caption *FormattedText `json:"caption"`
2023-06-04 22:58:07 +02:00
// Photo self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats
SelfDestructTime int32 `json:"self_destruct_time"`
// True, if the photo preview must be covered by a spoiler animation; not supported in secret chats
HasSpoiler bool `json:"has_spoiler"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessagePhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessagePhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessagePhoto) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessagePhoto) GetType() string {
return TypeInputMessagePhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessagePhoto) InputMessageContentType() string {
return TypeInputMessagePhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error {
var tmp struct {
Photo json.RawMessage `json:"photo"`
Thumbnail *InputThumbnail `json:"thumbnail"`
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
Width int32 `json:"width"`
Height int32 `json:"height"`
Caption *FormattedText `json:"caption"`
2023-06-04 22:58:07 +02:00
SelfDestructTime int32 `json:"self_destruct_time"`
HasSpoiler bool `json:"has_spoiler"`
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
inputMessagePhoto.Thumbnail = tmp.Thumbnail
inputMessagePhoto.AddedStickerFileIds = tmp.AddedStickerFileIds
inputMessagePhoto.Width = tmp.Width
inputMessagePhoto.Height = tmp.Height
inputMessagePhoto.Caption = tmp.Caption
2023-06-04 22:58:07 +02:00
inputMessagePhoto.SelfDestructTime = tmp.SelfDestructTime
inputMessagePhoto.HasSpoiler = tmp.HasSpoiler
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldPhoto, _ := UnmarshalInputFile(tmp.Photo)
inputMessagePhoto.Photo = fieldPhoto
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A sticker message
type InputMessageSticker struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Sticker to be sent
Sticker InputFile `json:"sticker"`
// Sticker thumbnail; pass null to skip thumbnail uploading
Thumbnail *InputThumbnail `json:"thumbnail"`
// Sticker width
Width int32 `json:"width"`
// Sticker height
Height int32 `json:"height"`
// Emoji used to choose the sticker
Emoji string `json:"emoji"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageSticker) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageSticker
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageSticker) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageSticker) GetType() string {
return TypeInputMessageSticker
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageSticker) InputMessageContentType() string {
return TypeInputMessageSticker
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputMessageSticker *InputMessageSticker) UnmarshalJSON(data []byte) error {
var tmp struct {
Sticker json.RawMessage `json:"sticker"`
Thumbnail *InputThumbnail `json:"thumbnail"`
Width int32 `json:"width"`
Height int32 `json:"height"`
Emoji string `json:"emoji"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
inputMessageSticker.Thumbnail = tmp.Thumbnail
inputMessageSticker.Width = tmp.Width
inputMessageSticker.Height = tmp.Height
inputMessageSticker.Emoji = tmp.Emoji
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldSticker, _ := UnmarshalInputFile(tmp.Sticker)
inputMessageSticker.Sticker = fieldSticker
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A video message
type InputMessageVideo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Video to be sent
Video InputFile `json:"video"`
// Video thumbnail; pass null to skip thumbnail uploading
Thumbnail *InputThumbnail `json:"thumbnail"`
// File identifiers of the stickers added to the video, if applicable
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
// Duration of the video, in seconds
Duration int32 `json:"duration"`
// Video width
Width int32 `json:"width"`
// Video height
Height int32 `json:"height"`
// True, if the video is supposed to be streamed
SupportsStreaming bool `json:"supports_streaming"`
2023-06-04 22:58:07 +02:00
// Video caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
2021-12-08 10:23:00 +01:00
Caption *FormattedText `json:"caption"`
2023-06-04 22:58:07 +02:00
// Video self-destruct time, in seconds (0-60). A non-zero self-destruct time can be specified only in private chats
SelfDestructTime int32 `json:"self_destruct_time"`
// True, if the video preview must be covered by a spoiler animation; not supported in secret chats
HasSpoiler bool `json:"has_spoiler"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageVideo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageVideo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVideo) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVideo) GetType() string {
return TypeInputMessageVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVideo) InputMessageContentType() string {
return TypeInputMessageVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error {
var tmp struct {
Video json.RawMessage `json:"video"`
Thumbnail *InputThumbnail `json:"thumbnail"`
AddedStickerFileIds []int32 `json:"added_sticker_file_ids"`
Duration int32 `json:"duration"`
Width int32 `json:"width"`
Height int32 `json:"height"`
SupportsStreaming bool `json:"supports_streaming"`
Caption *FormattedText `json:"caption"`
2023-06-04 22:58:07 +02:00
SelfDestructTime int32 `json:"self_destruct_time"`
HasSpoiler bool `json:"has_spoiler"`
2021-12-08 10:23:00 +01:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputMessageVideo.Thumbnail = tmp.Thumbnail
inputMessageVideo.AddedStickerFileIds = tmp.AddedStickerFileIds
inputMessageVideo.Duration = tmp.Duration
inputMessageVideo.Width = tmp.Width
inputMessageVideo.Height = tmp.Height
inputMessageVideo.SupportsStreaming = tmp.SupportsStreaming
inputMessageVideo.Caption = tmp.Caption
2023-06-04 22:58:07 +02:00
inputMessageVideo.SelfDestructTime = tmp.SelfDestructTime
inputMessageVideo.HasSpoiler = tmp.HasSpoiler
2021-12-08 10:23:00 +01:00
fieldVideo, _ := UnmarshalInputFile(tmp.Video)
inputMessageVideo.Video = fieldVideo
return nil
}
// A video note message
type InputMessageVideoNote struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Video note to be sent
VideoNote InputFile `json:"video_note"`
// Video thumbnail; pass null to skip thumbnail uploading
Thumbnail *InputThumbnail `json:"thumbnail"`
// Duration of the video, in seconds
Duration int32 `json:"duration"`
// Video width and height; must be positive and not greater than 640
Length int32 `json:"length"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageVideoNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageVideoNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVideoNote) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVideoNote) GetType() string {
return TypeInputMessageVideoNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVideoNote) InputMessageContentType() string {
return TypeInputMessageVideoNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputMessageVideoNote *InputMessageVideoNote) UnmarshalJSON(data []byte) error {
var tmp struct {
VideoNote json.RawMessage `json:"video_note"`
Thumbnail *InputThumbnail `json:"thumbnail"`
Duration int32 `json:"duration"`
Length int32 `json:"length"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputMessageVideoNote.Thumbnail = tmp.Thumbnail
inputMessageVideoNote.Duration = tmp.Duration
inputMessageVideoNote.Length = tmp.Length
fieldVideoNote, _ := UnmarshalInputFile(tmp.VideoNote)
inputMessageVideoNote.VideoNote = fieldVideoNote
return nil
}
// A voice note message
type InputMessageVoiceNote struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Voice note to be sent
VoiceNote InputFile `json:"voice_note"`
// Duration of the voice note, in seconds
Duration int32 `json:"duration"`
2023-06-04 22:58:07 +02:00
// Waveform representation of the voice note in 5-bit format
2021-12-08 10:23:00 +01:00
Waveform []byte `json:"waveform"`
2023-06-04 22:58:07 +02:00
// Voice note caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
2021-12-08 10:23:00 +01:00
Caption *FormattedText `json:"caption"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageVoiceNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageVoiceNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVoiceNote) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVoiceNote) GetType() string {
return TypeInputMessageVoiceNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVoiceNote) InputMessageContentType() string {
return TypeInputMessageVoiceNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputMessageVoiceNote *InputMessageVoiceNote) UnmarshalJSON(data []byte) error {
var tmp struct {
VoiceNote json.RawMessage `json:"voice_note"`
Duration int32 `json:"duration"`
Waveform []byte `json:"waveform"`
Caption *FormattedText `json:"caption"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputMessageVoiceNote.Duration = tmp.Duration
inputMessageVoiceNote.Waveform = tmp.Waveform
inputMessageVoiceNote.Caption = tmp.Caption
fieldVoiceNote, _ := UnmarshalInputFile(tmp.VoiceNote)
inputMessageVoiceNote.VoiceNote = fieldVoiceNote
return nil
}
// A message with a location
type InputMessageLocation struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Location to be sent
Location *Location `json:"location"`
// Period for which the location can be updated, in seconds; must be between 60 and 86400 for a live location and 0 otherwise
LivePeriod int32 `json:"live_period"`
// For live locations, a direction in which the location moves, in degrees; 1-360. Pass 0 if unknown
Heading int32 `json:"heading"`
// For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled. Can't be enabled in channels and Saved Messages
ProximityAlertRadius int32 `json:"proximity_alert_radius"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageLocation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageLocation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageLocation) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageLocation) GetType() string {
return TypeInputMessageLocation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageLocation) InputMessageContentType() string {
return TypeInputMessageLocation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message with information about a venue
type InputMessageVenue struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Venue to send
Venue *Venue `json:"venue"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageVenue) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageVenue
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVenue) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVenue) GetType() string {
return TypeInputMessageVenue
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageVenue) InputMessageContentType() string {
return TypeInputMessageVenue
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message containing a user contact
type InputMessageContact struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Contact to send
Contact *Contact `json:"contact"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageContact) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageContact
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageContact) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageContact) GetType() string {
return TypeInputMessageContact
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageContact) InputMessageContentType() string {
return TypeInputMessageContact
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A dice message
type InputMessageDice struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Emoji on which the dice throw animation is based
Emoji string `json:"emoji"`
// True, if the chat message draft must be deleted
ClearDraft bool `json:"clear_draft"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageDice) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageDice
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageDice) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageDice) GetType() string {
return TypeInputMessageDice
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageDice) InputMessageContentType() string {
return TypeInputMessageDice
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message with a game; not supported for channels or secret chats
type InputMessageGame struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// User identifier of the bot that owns the game
BotUserId int64 `json:"bot_user_id"`
// Short name of the game
GameShortName string `json:"game_short_name"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageGame) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageGame
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageGame) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageGame) GetType() string {
return TypeInputMessageGame
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageGame) InputMessageContentType() string {
return TypeInputMessageGame
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A message with an invoice; can be used only by bots
type InputMessageInvoice struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Invoice
Invoice *Invoice `json:"invoice"`
// Product title; 1-32 characters
Title string `json:"title"`
// Product description; 0-255 characters
Description string `json:"description"`
// Product photo URL; optional
PhotoUrl string `json:"photo_url"`
// Product photo size
PhotoSize int32 `json:"photo_size"`
// Product photo width
PhotoWidth int32 `json:"photo_width"`
// Product photo height
PhotoHeight int32 `json:"photo_height"`
// The invoice payload
Payload []byte `json:"payload"`
// Payment provider token
ProviderToken string `json:"provider_token"`
// JSON-encoded data about the invoice, which will be shared with the payment provider
ProviderData string `json:"provider_data"`
// Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message
StartParameter string `json:"start_parameter"`
2023-06-04 22:58:07 +02:00
// The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo
ExtendedMediaContent InputMessageContent `json:"extended_media_content"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageInvoice) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageInvoice
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageInvoice) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageInvoice) GetType() string {
return TypeInputMessageInvoice
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageInvoice) InputMessageContentType() string {
return TypeInputMessageInvoice
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (inputMessageInvoice *InputMessageInvoice) UnmarshalJSON(data []byte) error {
var tmp struct {
Invoice *Invoice `json:"invoice"`
Title string `json:"title"`
Description string `json:"description"`
PhotoUrl string `json:"photo_url"`
PhotoSize int32 `json:"photo_size"`
PhotoWidth int32 `json:"photo_width"`
PhotoHeight int32 `json:"photo_height"`
Payload []byte `json:"payload"`
ProviderToken string `json:"provider_token"`
ProviderData string `json:"provider_data"`
StartParameter string `json:"start_parameter"`
ExtendedMediaContent json.RawMessage `json:"extended_media_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputMessageInvoice.Invoice = tmp.Invoice
inputMessageInvoice.Title = tmp.Title
inputMessageInvoice.Description = tmp.Description
inputMessageInvoice.PhotoUrl = tmp.PhotoUrl
inputMessageInvoice.PhotoSize = tmp.PhotoSize
inputMessageInvoice.PhotoWidth = tmp.PhotoWidth
inputMessageInvoice.PhotoHeight = tmp.PhotoHeight
inputMessageInvoice.Payload = tmp.Payload
inputMessageInvoice.ProviderToken = tmp.ProviderToken
inputMessageInvoice.ProviderData = tmp.ProviderData
inputMessageInvoice.StartParameter = tmp.StartParameter
fieldExtendedMediaContent, _ := UnmarshalInputMessageContent(tmp.ExtendedMediaContent)
inputMessageInvoice.ExtendedMediaContent = fieldExtendedMediaContent
return nil
}
2021-12-08 10:23:00 +01:00
// A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot
type InputMessagePoll struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Poll question; 1-255 characters (up to 300 characters for bots)
Question string `json:"question"`
// List of poll answer options, 2-10 strings 1-100 characters each
Options []string `json:"options"`
// True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels
IsAnonymous bool `json:"is_anonymous"`
// Type of the poll
Type PollType `json:"type"`
// Amount of time the poll will be active after creation, in seconds; for bots only
OpenPeriod int32 `json:"open_period"`
// Point in time (Unix timestamp) when the poll will automatically be closed; for bots only
CloseDate int32 `json:"close_date"`
// True, if the poll needs to be sent already closed; for bots only
IsClosed bool `json:"is_closed"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessagePoll) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessagePoll
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessagePoll) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessagePoll) GetType() string {
return TypeInputMessagePoll
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessagePoll) InputMessageContentType() string {
return TypeInputMessagePoll
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error {
var tmp struct {
Question string `json:"question"`
Options []string `json:"options"`
IsAnonymous bool `json:"is_anonymous"`
Type json.RawMessage `json:"type"`
OpenPeriod int32 `json:"open_period"`
CloseDate int32 `json:"close_date"`
IsClosed bool `json:"is_closed"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputMessagePoll.Question = tmp.Question
inputMessagePoll.Options = tmp.Options
inputMessagePoll.IsAnonymous = tmp.IsAnonymous
inputMessagePoll.OpenPeriod = tmp.OpenPeriod
inputMessagePoll.CloseDate = tmp.CloseDate
inputMessagePoll.IsClosed = tmp.IsClosed
fieldType, _ := UnmarshalPollType(tmp.Type)
inputMessagePoll.Type = fieldType
return nil
}
// A forwarded message
type InputMessageForwarded struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier for the chat this forwarded message came from
FromChatId int64 `json:"from_chat_id"`
// Identifier of the message to forward
MessageId int64 `json:"message_id"`
// True, if a game message is being shared from a launched game; applies only to game messages
InGameShare bool `json:"in_game_share"`
2022-04-18 22:45:01 +02:00
// Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual
2021-12-08 10:23:00 +01:00
CopyOptions *MessageCopyOptions `json:"copy_options"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InputMessageForwarded) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InputMessageForwarded
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InputMessageForwarded) GetClass() string {
return ClassInputMessageContent
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageForwarded) GetType() string {
return TypeInputMessageForwarded
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InputMessageForwarded) InputMessageContentType() string {
return TypeInputMessageForwarded
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Returns all found messages, no filter is applied
type SearchMessagesFilterEmpty struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterEmpty) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterEmpty
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterEmpty) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterEmpty) GetType() string {
return TypeSearchMessagesFilterEmpty
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterEmpty) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterEmpty
}
// Returns only animation messages
type SearchMessagesFilterAnimation struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterAnimation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterAnimation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterAnimation) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterAnimation) GetType() string {
return TypeSearchMessagesFilterAnimation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterAnimation) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterAnimation
}
// Returns only audio messages
type SearchMessagesFilterAudio struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterAudio) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterAudio
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterAudio) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterAudio) GetType() string {
return TypeSearchMessagesFilterAudio
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterAudio) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterAudio
}
// Returns only document messages
type SearchMessagesFilterDocument struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterDocument) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterDocument
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterDocument) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterDocument) GetType() string {
return TypeSearchMessagesFilterDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterDocument) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterDocument
}
// Returns only photo messages
type SearchMessagesFilterPhoto struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterPhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterPhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterPhoto) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterPhoto) GetType() string {
return TypeSearchMessagesFilterPhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterPhoto) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterPhoto
}
// Returns only video messages
type SearchMessagesFilterVideo struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterVideo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterVideo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVideo) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVideo) GetType() string {
return TypeSearchMessagesFilterVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVideo) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Returns only voice note messages
type SearchMessagesFilterVoiceNote struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterVoiceNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterVoiceNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVoiceNote) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVoiceNote) GetType() string {
return TypeSearchMessagesFilterVoiceNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVoiceNote) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterVoiceNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Returns only photo and video messages
type SearchMessagesFilterPhotoAndVideo struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterPhotoAndVideo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterPhotoAndVideo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterPhotoAndVideo) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterPhotoAndVideo) GetType() string {
return TypeSearchMessagesFilterPhotoAndVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterPhotoAndVideo) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterPhotoAndVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Returns only messages containing URLs
type SearchMessagesFilterUrl struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterUrl) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterUrl
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterUrl) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterUrl) GetType() string {
return TypeSearchMessagesFilterUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterUrl) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterUrl
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Returns only messages containing chat photos
type SearchMessagesFilterChatPhoto struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterChatPhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterChatPhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterChatPhoto) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterChatPhoto) GetType() string {
return TypeSearchMessagesFilterChatPhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterChatPhoto) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterChatPhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Returns only video note messages
type SearchMessagesFilterVideoNote struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterVideoNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterVideoNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVideoNote) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVideoNote) GetType() string {
return TypeSearchMessagesFilterVideoNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVideoNote) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterVideoNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Returns only voice and video note messages
type SearchMessagesFilterVoiceAndVideoNote struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterVoiceAndVideoNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterVoiceAndVideoNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVoiceAndVideoNote) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVoiceAndVideoNote) GetType() string {
return TypeSearchMessagesFilterVoiceAndVideoNote
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterVoiceAndVideoNote) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterVoiceAndVideoNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Returns only messages with mentions of the current user, or messages that are replies to their messages
type SearchMessagesFilterMention struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterMention) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterMention
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterMention) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterMention) GetType() string {
return TypeSearchMessagesFilterMention
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterMention) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterMention
}
// Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user
type SearchMessagesFilterUnreadMention struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterUnreadMention) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterUnreadMention
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterUnreadMention) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterUnreadMention) GetType() string {
return TypeSearchMessagesFilterUnreadMention
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterUnreadMention) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterUnreadMention
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user
type SearchMessagesFilterUnreadReaction struct {
meta
}
func (entity *SearchMessagesFilterUnreadReaction) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SearchMessagesFilterUnreadReaction
return json.Marshal((*stub)(entity))
}
func (*SearchMessagesFilterUnreadReaction) GetClass() string {
return ClassSearchMessagesFilter
}
func (*SearchMessagesFilterUnreadReaction) GetType() string {
return TypeSearchMessagesFilterUnreadReaction
}
func (*SearchMessagesFilterUnreadReaction) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterUnreadReaction
}
2021-12-08 10:23:00 +01:00
// Returns only failed to send messages. This filter can be used only if the message database is used
type SearchMessagesFilterFailedToSend struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterFailedToSend) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterFailedToSend
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterFailedToSend) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterFailedToSend) GetType() string {
return TypeSearchMessagesFilterFailedToSend
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterFailedToSend) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterFailedToSend
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Returns only pinned messages
type SearchMessagesFilterPinned struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *SearchMessagesFilterPinned) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub SearchMessagesFilterPinned
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterPinned) GetClass() string {
return ClassSearchMessagesFilter
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterPinned) GetType() string {
return TypeSearchMessagesFilterPinned
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*SearchMessagesFilterPinned) SearchMessagesFilterType() string {
return TypeSearchMessagesFilterPinned
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is typing a message
type ChatActionTyping struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionTyping) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionTyping
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionTyping) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionTyping) GetType() string {
return TypeChatActionTyping
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionTyping) ChatActionType() string {
return TypeChatActionTyping
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is recording a video
type ChatActionRecordingVideo struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionRecordingVideo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionRecordingVideo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionRecordingVideo) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionRecordingVideo) GetType() string {
return TypeChatActionRecordingVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionRecordingVideo) ChatActionType() string {
return TypeChatActionRecordingVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is uploading a video
type ChatActionUploadingVideo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Upload progress, as a percentage
Progress int32 `json:"progress"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionUploadingVideo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionUploadingVideo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingVideo) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingVideo) GetType() string {
return TypeChatActionUploadingVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingVideo) ChatActionType() string {
return TypeChatActionUploadingVideo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is recording a voice note
type ChatActionRecordingVoiceNote struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionRecordingVoiceNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionRecordingVoiceNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionRecordingVoiceNote) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionRecordingVoiceNote) GetType() string {
return TypeChatActionRecordingVoiceNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionRecordingVoiceNote) ChatActionType() string {
return TypeChatActionRecordingVoiceNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is uploading a voice note
type ChatActionUploadingVoiceNote struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Upload progress, as a percentage
Progress int32 `json:"progress"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionUploadingVoiceNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionUploadingVoiceNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingVoiceNote) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingVoiceNote) GetType() string {
return TypeChatActionUploadingVoiceNote
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingVoiceNote) ChatActionType() string {
return TypeChatActionUploadingVoiceNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is uploading a photo
type ChatActionUploadingPhoto struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Upload progress, as a percentage
Progress int32 `json:"progress"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionUploadingPhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionUploadingPhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingPhoto) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingPhoto) GetType() string {
return TypeChatActionUploadingPhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingPhoto) ChatActionType() string {
return TypeChatActionUploadingPhoto
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is uploading a document
type ChatActionUploadingDocument struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Upload progress, as a percentage
Progress int32 `json:"progress"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionUploadingDocument) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionUploadingDocument
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingDocument) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingDocument) GetType() string {
return TypeChatActionUploadingDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingDocument) ChatActionType() string {
return TypeChatActionUploadingDocument
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is picking a sticker to send
type ChatActionChoosingSticker struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionChoosingSticker) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionChoosingSticker
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionChoosingSticker) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionChoosingSticker) GetType() string {
return TypeChatActionChoosingSticker
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionChoosingSticker) ChatActionType() string {
return TypeChatActionChoosingSticker
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is picking a location or venue to send
type ChatActionChoosingLocation struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionChoosingLocation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionChoosingLocation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionChoosingLocation) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionChoosingLocation) GetType() string {
return TypeChatActionChoosingLocation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionChoosingLocation) ChatActionType() string {
return TypeChatActionChoosingLocation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is picking a contact to send
type ChatActionChoosingContact struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionChoosingContact) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionChoosingContact
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionChoosingContact) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionChoosingContact) GetType() string {
return TypeChatActionChoosingContact
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionChoosingContact) ChatActionType() string {
return TypeChatActionChoosingContact
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user has started to play a game
type ChatActionStartPlayingGame struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionStartPlayingGame) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionStartPlayingGame
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionStartPlayingGame) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionStartPlayingGame) GetType() string {
return TypeChatActionStartPlayingGame
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionStartPlayingGame) ChatActionType() string {
return TypeChatActionStartPlayingGame
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is recording a video note
type ChatActionRecordingVideoNote struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionRecordingVideoNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionRecordingVideoNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionRecordingVideoNote) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionRecordingVideoNote) GetType() string {
return TypeChatActionRecordingVideoNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionRecordingVideoNote) ChatActionType() string {
return TypeChatActionRecordingVideoNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is uploading a video note
type ChatActionUploadingVideoNote struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Upload progress, as a percentage
Progress int32 `json:"progress"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionUploadingVideoNote) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionUploadingVideoNote
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingVideoNote) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingVideoNote) GetType() string {
return TypeChatActionUploadingVideoNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionUploadingVideoNote) ChatActionType() string {
return TypeChatActionUploadingVideoNote
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is watching animations sent by the other party by clicking on an animated emoji
type ChatActionWatchingAnimations struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The animated emoji
Emoji string `json:"emoji"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionWatchingAnimations) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionWatchingAnimations
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionWatchingAnimations) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionWatchingAnimations) GetType() string {
return TypeChatActionWatchingAnimations
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionWatchingAnimations) ChatActionType() string {
return TypeChatActionWatchingAnimations
}
// The user has canceled the previous action
type ChatActionCancel struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatActionCancel) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatActionCancel
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatActionCancel) GetClass() string {
return ClassChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionCancel) GetType() string {
return TypeChatActionCancel
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatActionCancel) ChatActionType() string {
return TypeChatActionCancel
}
// The user status was never changed
type UserStatusEmpty struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *UserStatusEmpty) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub UserStatusEmpty
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*UserStatusEmpty) GetClass() string {
return ClassUserStatus
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UserStatusEmpty) GetType() string {
return TypeUserStatusEmpty
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UserStatusEmpty) UserStatusType() string {
return TypeUserStatusEmpty
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is online
type UserStatusOnline struct {
meta
// Point in time (Unix timestamp) when the user's online status will expire
Expires int32 `json:"expires"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *UserStatusOnline) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub UserStatusOnline
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*UserStatusOnline) GetClass() string {
return ClassUserStatus
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UserStatusOnline) GetType() string {
return TypeUserStatusOnline
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UserStatusOnline) UserStatusType() string {
return TypeUserStatusOnline
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is offline
type UserStatusOffline struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Point in time (Unix timestamp) when the user was last online
WasOnline int32 `json:"was_online"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *UserStatusOffline) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub UserStatusOffline
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*UserStatusOffline) GetClass() string {
return ClassUserStatus
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UserStatusOffline) GetType() string {
return TypeUserStatusOffline
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UserStatusOffline) UserStatusType() string {
return TypeUserStatusOffline
}
// The user was online recently
type UserStatusRecently struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *UserStatusRecently) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub UserStatusRecently
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*UserStatusRecently) GetClass() string {
return ClassUserStatus
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UserStatusRecently) GetType() string {
return TypeUserStatusRecently
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UserStatusRecently) UserStatusType() string {
return TypeUserStatusRecently
}
// The user is offline, but was online last week
type UserStatusLastWeek struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *UserStatusLastWeek) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub UserStatusLastWeek
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*UserStatusLastWeek) GetClass() string {
return ClassUserStatus
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UserStatusLastWeek) GetType() string {
return TypeUserStatusLastWeek
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UserStatusLastWeek) UserStatusType() string {
return TypeUserStatusLastWeek
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The user is offline, but was online last month
type UserStatusLastMonth struct {
meta
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (entity *UserStatusLastMonth) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub UserStatusLastMonth
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*UserStatusLastMonth) GetClass() string {
return ClassUserStatus
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*UserStatusLastMonth) GetType() string {
return TypeUserStatusLastMonth
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UserStatusLastMonth) UserStatusType() string {
return TypeUserStatusLastMonth
}
// Represents a list of stickers
type Stickers struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of stickers
Stickers []*Sticker `json:"stickers"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Stickers) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Stickers
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Stickers) GetClass() string {
return ClassStickers
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Stickers) GetType() string {
return TypeStickers
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Represents a list of emoji
type Emojis struct {
meta
// List of emojis
Emojis []string `json:"emojis"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Emojis) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub Emojis
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*Emojis) GetClass() string {
return ClassEmojis
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*Emojis) GetType() string {
return TypeEmojis
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Represents a sticker set
type StickerSet struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the sticker set
Id JsonInt64 `json:"id"`
// Title of the sticker set
2021-10-22 16:24:12 +02:00
Title string `json:"title"`
2021-12-08 10:23:00 +01:00
// Name of the sticker set
Name string `json:"name"`
2023-06-04 22:58:07 +02:00
// Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed
2021-12-08 10:23:00 +01:00
Thumbnail *Thumbnail `json:"thumbnail"`
// Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"`
// True, if the sticker set has been installed by the current user
IsInstalled bool `json:"is_installed"`
// True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
IsArchived bool `json:"is_archived"`
// True, if the sticker set is official
IsOfficial bool `json:"is_official"`
2023-06-04 22:58:07 +02:00
// Format of the stickers in the set
StickerFormat StickerFormat `json:"sticker_format"`
// Type of the stickers in the set
StickerType StickerType `json:"sticker_type"`
2021-12-08 10:23:00 +01:00
// True for already viewed trending sticker sets
IsViewed bool `json:"is_viewed"`
// List of stickers in this set
Stickers []*Sticker `json:"stickers"`
// A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object
Emojis []*Emojis `json:"emojis"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *StickerSet) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub StickerSet
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*StickerSet) GetClass() string {
return ClassStickerSet
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*StickerSet) GetType() string {
return TypeStickerSet
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error {
var tmp struct {
Id JsonInt64 `json:"id"`
Title string `json:"title"`
Name string `json:"name"`
Thumbnail *Thumbnail `json:"thumbnail"`
ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"`
IsInstalled bool `json:"is_installed"`
IsArchived bool `json:"is_archived"`
IsOfficial bool `json:"is_official"`
StickerFormat json.RawMessage `json:"sticker_format"`
StickerType json.RawMessage `json:"sticker_type"`
IsViewed bool `json:"is_viewed"`
Stickers []*Sticker `json:"stickers"`
Emojis []*Emojis `json:"emojis"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
stickerSet.Id = tmp.Id
stickerSet.Title = tmp.Title
stickerSet.Name = tmp.Name
stickerSet.Thumbnail = tmp.Thumbnail
stickerSet.ThumbnailOutline = tmp.ThumbnailOutline
stickerSet.IsInstalled = tmp.IsInstalled
stickerSet.IsArchived = tmp.IsArchived
stickerSet.IsOfficial = tmp.IsOfficial
stickerSet.IsViewed = tmp.IsViewed
stickerSet.Stickers = tmp.Stickers
stickerSet.Emojis = tmp.Emojis
fieldStickerFormat, _ := UnmarshalStickerFormat(tmp.StickerFormat)
stickerSet.StickerFormat = fieldStickerFormat
fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType)
stickerSet.StickerType = fieldStickerType
return nil
}
2021-12-08 10:23:00 +01:00
// Represents short information about a sticker set
type StickerSetInfo struct {
meta
// Identifier of the sticker set
Id JsonInt64 `json:"id"`
// Title of the sticker set
Title string `json:"title"`
// Name of the sticker set
Name string `json:"name"`
2023-06-04 22:58:07 +02:00
// Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null
2021-12-08 10:23:00 +01:00
Thumbnail *Thumbnail `json:"thumbnail"`
// Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"`
// True, if the sticker set has been installed by the current user
IsInstalled bool `json:"is_installed"`
// True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
IsArchived bool `json:"is_archived"`
// True, if the sticker set is official
IsOfficial bool `json:"is_official"`
2023-06-04 22:58:07 +02:00
// Format of the stickers in the set
StickerFormat StickerFormat `json:"sticker_format"`
// Type of the stickers in the set
StickerType StickerType `json:"sticker_type"`
2021-12-08 10:23:00 +01:00
// True for already viewed trending sticker sets
IsViewed bool `json:"is_viewed"`
// Total number of stickers in the set
Size int32 `json:"size"`
// Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested
Covers []*Sticker `json:"covers"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *StickerSetInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub StickerSetInfo
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*StickerSetInfo) GetClass() string {
return ClassStickerSetInfo
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*StickerSetInfo) GetType() string {
return TypeStickerSetInfo
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error {
var tmp struct {
Id JsonInt64 `json:"id"`
Title string `json:"title"`
Name string `json:"name"`
Thumbnail *Thumbnail `json:"thumbnail"`
ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"`
IsInstalled bool `json:"is_installed"`
IsArchived bool `json:"is_archived"`
IsOfficial bool `json:"is_official"`
StickerFormat json.RawMessage `json:"sticker_format"`
StickerType json.RawMessage `json:"sticker_type"`
IsViewed bool `json:"is_viewed"`
Size int32 `json:"size"`
Covers []*Sticker `json:"covers"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
stickerSetInfo.Id = tmp.Id
stickerSetInfo.Title = tmp.Title
stickerSetInfo.Name = tmp.Name
stickerSetInfo.Thumbnail = tmp.Thumbnail
stickerSetInfo.ThumbnailOutline = tmp.ThumbnailOutline
stickerSetInfo.IsInstalled = tmp.IsInstalled
stickerSetInfo.IsArchived = tmp.IsArchived
stickerSetInfo.IsOfficial = tmp.IsOfficial
stickerSetInfo.IsViewed = tmp.IsViewed
stickerSetInfo.Size = tmp.Size
stickerSetInfo.Covers = tmp.Covers
fieldStickerFormat, _ := UnmarshalStickerFormat(tmp.StickerFormat)
stickerSetInfo.StickerFormat = fieldStickerFormat
fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType)
stickerSetInfo.StickerType = fieldStickerType
return nil
}
2021-12-08 10:23:00 +01:00
// Represents a list of sticker sets
type StickerSets struct {
meta
// Approximate total number of sticker sets found
TotalCount int32 `json:"total_count"`
// List of sticker sets
Sets []*StickerSetInfo `json:"sets"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *StickerSets) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StickerSets
return json.Marshal((*stub)(entity))
}
func (*StickerSets) GetClass() string {
return ClassStickerSets
}
func (*StickerSets) GetType() string {
return TypeStickerSets
}
2023-06-04 22:58:07 +02:00
// Represents a list of trending sticker sets
type TrendingStickerSets struct {
meta
// Approximate total number of trending sticker sets
TotalCount int32 `json:"total_count"`
// List of trending sticker sets
Sets []*StickerSetInfo `json:"sets"`
// True, if the list contains sticker sets with premium stickers
IsPremium bool `json:"is_premium"`
}
func (entity *TrendingStickerSets) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TrendingStickerSets
return json.Marshal((*stub)(entity))
}
func (*TrendingStickerSets) GetClass() string {
return ClassTrendingStickerSets
}
func (*TrendingStickerSets) GetType() string {
return TypeTrendingStickerSets
}
2021-12-08 10:23:00 +01:00
// The call wasn't discarded, or the reason is unknown
type CallDiscardReasonEmpty struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *CallDiscardReasonEmpty) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub CallDiscardReasonEmpty
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*CallDiscardReasonEmpty) GetClass() string {
return ClassCallDiscardReason
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*CallDiscardReasonEmpty) GetType() string {
return TypeCallDiscardReasonEmpty
}
func (*CallDiscardReasonEmpty) CallDiscardReasonType() string {
return TypeCallDiscardReasonEmpty
}
// The call was ended before the conversation started. It was canceled by the caller or missed by the other party
type CallDiscardReasonMissed struct {
meta
}
func (entity *CallDiscardReasonMissed) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallDiscardReasonMissed
return json.Marshal((*stub)(entity))
}
func (*CallDiscardReasonMissed) GetClass() string {
return ClassCallDiscardReason
}
func (*CallDiscardReasonMissed) GetType() string {
return TypeCallDiscardReasonMissed
}
func (*CallDiscardReasonMissed) CallDiscardReasonType() string {
return TypeCallDiscardReasonMissed
}
// The call was ended before the conversation started. It was declined by the other party
type CallDiscardReasonDeclined struct {
meta
}
func (entity *CallDiscardReasonDeclined) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallDiscardReasonDeclined
return json.Marshal((*stub)(entity))
}
func (*CallDiscardReasonDeclined) GetClass() string {
return ClassCallDiscardReason
}
func (*CallDiscardReasonDeclined) GetType() string {
return TypeCallDiscardReasonDeclined
}
func (*CallDiscardReasonDeclined) CallDiscardReasonType() string {
return TypeCallDiscardReasonDeclined
}
// The call was ended during the conversation because the users were disconnected
type CallDiscardReasonDisconnected struct {
meta
}
func (entity *CallDiscardReasonDisconnected) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallDiscardReasonDisconnected
return json.Marshal((*stub)(entity))
}
func (*CallDiscardReasonDisconnected) GetClass() string {
return ClassCallDiscardReason
}
func (*CallDiscardReasonDisconnected) GetType() string {
return TypeCallDiscardReasonDisconnected
}
func (*CallDiscardReasonDisconnected) CallDiscardReasonType() string {
return TypeCallDiscardReasonDisconnected
}
// The call was ended because one of the parties hung up
type CallDiscardReasonHungUp struct {
meta
}
func (entity *CallDiscardReasonHungUp) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallDiscardReasonHungUp
return json.Marshal((*stub)(entity))
}
func (*CallDiscardReasonHungUp) GetClass() string {
return ClassCallDiscardReason
}
func (*CallDiscardReasonHungUp) GetType() string {
return TypeCallDiscardReasonHungUp
}
func (*CallDiscardReasonHungUp) CallDiscardReasonType() string {
return TypeCallDiscardReasonHungUp
}
// Specifies the supported call protocols
type CallProtocol struct {
meta
// True, if UDP peer-to-peer connections are supported
UdpP2p bool `json:"udp_p2p"`
// True, if connection through UDP reflectors is supported
UdpReflector bool `json:"udp_reflector"`
// The minimum supported API layer; use 65
MinLayer int32 `json:"min_layer"`
// The maximum supported API layer; use 65
MaxLayer int32 `json:"max_layer"`
// List of supported tgcalls versions
LibraryVersions []string `json:"library_versions"`
}
func (entity *CallProtocol) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallProtocol
return json.Marshal((*stub)(entity))
}
func (*CallProtocol) GetClass() string {
return ClassCallProtocol
}
func (*CallProtocol) GetType() string {
return TypeCallProtocol
}
// A Telegram call reflector
type CallServerTypeTelegramReflector struct {
meta
// A peer tag to be used with the reflector
PeerTag []byte `json:"peer_tag"`
2023-06-04 22:58:07 +02:00
// True, if the server uses TCP instead of UDP
IsTcp bool `json:"is_tcp"`
2021-12-08 10:23:00 +01:00
}
func (entity *CallServerTypeTelegramReflector) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallServerTypeTelegramReflector
return json.Marshal((*stub)(entity))
}
func (*CallServerTypeTelegramReflector) GetClass() string {
return ClassCallServerType
}
func (*CallServerTypeTelegramReflector) GetType() string {
return TypeCallServerTypeTelegramReflector
}
func (*CallServerTypeTelegramReflector) CallServerTypeType() string {
return TypeCallServerTypeTelegramReflector
}
// A WebRTC server
type CallServerTypeWebrtc struct {
meta
// Username to be used for authentication
Username string `json:"username"`
// Authentication password
Password string `json:"password"`
// True, if the server supports TURN
SupportsTurn bool `json:"supports_turn"`
// True, if the server supports STUN
SupportsStun bool `json:"supports_stun"`
}
func (entity *CallServerTypeWebrtc) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallServerTypeWebrtc
return json.Marshal((*stub)(entity))
}
func (*CallServerTypeWebrtc) GetClass() string {
return ClassCallServerType
}
func (*CallServerTypeWebrtc) GetType() string {
return TypeCallServerTypeWebrtc
}
func (*CallServerTypeWebrtc) CallServerTypeType() string {
return TypeCallServerTypeWebrtc
}
// Describes a server for relaying call data
type CallServer struct {
meta
// Server identifier
Id JsonInt64 `json:"id"`
// Server IPv4 address
IpAddress string `json:"ip_address"`
// Server IPv6 address
Ipv6Address string `json:"ipv6_address"`
// Server port number
Port int32 `json:"port"`
// Server type
Type CallServerType `json:"type"`
}
func (entity *CallServer) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallServer
return json.Marshal((*stub)(entity))
}
func (*CallServer) GetClass() string {
return ClassCallServer
}
func (*CallServer) GetType() string {
return TypeCallServer
}
func (callServer *CallServer) UnmarshalJSON(data []byte) error {
var tmp struct {
Id JsonInt64 `json:"id"`
IpAddress string `json:"ip_address"`
Ipv6Address string `json:"ipv6_address"`
Port int32 `json:"port"`
Type json.RawMessage `json:"type"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
callServer.Id = tmp.Id
callServer.IpAddress = tmp.IpAddress
callServer.Ipv6Address = tmp.Ipv6Address
callServer.Port = tmp.Port
fieldType, _ := UnmarshalCallServerType(tmp.Type)
callServer.Type = fieldType
return nil
}
// Contains the call identifier
type CallId struct {
meta
// Call identifier
Id int32 `json:"id"`
}
func (entity *CallId) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallId
return json.Marshal((*stub)(entity))
}
func (*CallId) GetClass() string {
return ClassCallId
}
func (*CallId) GetType() string {
return TypeCallId
}
// Contains the group call identifier
type GroupCallId struct {
meta
// Group call identifier
Id int32 `json:"id"`
}
func (entity *GroupCallId) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallId
return json.Marshal((*stub)(entity))
}
func (*GroupCallId) GetClass() string {
return ClassGroupCallId
}
func (*GroupCallId) GetType() string {
return TypeGroupCallId
}
// The call is pending, waiting to be accepted by a user
type CallStatePending struct {
meta
// True, if the call has already been created by the server
IsCreated bool `json:"is_created"`
// True, if the call has already been received by the other party
IsReceived bool `json:"is_received"`
}
func (entity *CallStatePending) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallStatePending
return json.Marshal((*stub)(entity))
}
func (*CallStatePending) GetClass() string {
return ClassCallState
}
func (*CallStatePending) GetType() string {
return TypeCallStatePending
}
func (*CallStatePending) CallStateType() string {
return TypeCallStatePending
}
// The call has been answered and encryption keys are being exchanged
type CallStateExchangingKeys struct {
meta
}
func (entity *CallStateExchangingKeys) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallStateExchangingKeys
return json.Marshal((*stub)(entity))
}
func (*CallStateExchangingKeys) GetClass() string {
return ClassCallState
}
func (*CallStateExchangingKeys) GetType() string {
return TypeCallStateExchangingKeys
}
func (*CallStateExchangingKeys) CallStateType() string {
return TypeCallStateExchangingKeys
}
// The call is ready to use
type CallStateReady struct {
meta
// Call protocols supported by the peer
Protocol *CallProtocol `json:"protocol"`
// List of available call servers
Servers []*CallServer `json:"servers"`
// A JSON-encoded call config
Config string `json:"config"`
// Call encryption key
EncryptionKey []byte `json:"encryption_key"`
// Encryption key emojis fingerprint
Emojis []string `json:"emojis"`
// True, if peer-to-peer connection is allowed by users privacy settings
AllowP2p bool `json:"allow_p2p"`
}
func (entity *CallStateReady) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallStateReady
return json.Marshal((*stub)(entity))
}
func (*CallStateReady) GetClass() string {
return ClassCallState
}
func (*CallStateReady) GetType() string {
return TypeCallStateReady
}
func (*CallStateReady) CallStateType() string {
return TypeCallStateReady
}
// The call is hanging up after discardCall has been called
type CallStateHangingUp struct {
meta
}
func (entity *CallStateHangingUp) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallStateHangingUp
return json.Marshal((*stub)(entity))
}
func (*CallStateHangingUp) GetClass() string {
return ClassCallState
}
func (*CallStateHangingUp) GetType() string {
return TypeCallStateHangingUp
}
func (*CallStateHangingUp) CallStateType() string {
return TypeCallStateHangingUp
}
// The call has ended successfully
type CallStateDiscarded struct {
meta
// The reason, why the call has ended
Reason CallDiscardReason `json:"reason"`
// True, if the call rating must be sent to the server
NeedRating bool `json:"need_rating"`
// True, if the call debug information must be sent to the server
NeedDebugInformation bool `json:"need_debug_information"`
2023-06-04 22:58:07 +02:00
// True, if the call log must be sent to the server
NeedLog bool `json:"need_log"`
2021-12-08 10:23:00 +01:00
}
func (entity *CallStateDiscarded) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallStateDiscarded
return json.Marshal((*stub)(entity))
}
func (*CallStateDiscarded) GetClass() string {
return ClassCallState
}
func (*CallStateDiscarded) GetType() string {
return TypeCallStateDiscarded
}
func (*CallStateDiscarded) CallStateType() string {
return TypeCallStateDiscarded
}
func (callStateDiscarded *CallStateDiscarded) UnmarshalJSON(data []byte) error {
var tmp struct {
Reason json.RawMessage `json:"reason"`
NeedRating bool `json:"need_rating"`
NeedDebugInformation bool `json:"need_debug_information"`
2023-06-04 22:58:07 +02:00
NeedLog bool `json:"need_log"`
2021-12-08 10:23:00 +01:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
callStateDiscarded.NeedRating = tmp.NeedRating
callStateDiscarded.NeedDebugInformation = tmp.NeedDebugInformation
2023-06-04 22:58:07 +02:00
callStateDiscarded.NeedLog = tmp.NeedLog
2021-12-08 10:23:00 +01:00
fieldReason, _ := UnmarshalCallDiscardReason(tmp.Reason)
callStateDiscarded.Reason = fieldReason
return nil
}
// The call has ended with an error
type CallStateError struct {
meta
// Error. An error with the code 4005000 will be returned if an outgoing call is missed because of an expired timeout
Error *Error `json:"error"`
}
func (entity *CallStateError) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallStateError
return json.Marshal((*stub)(entity))
}
func (*CallStateError) GetClass() string {
return ClassCallState
}
func (*CallStateError) GetType() string {
return TypeCallStateError
}
func (*CallStateError) CallStateType() string {
return TypeCallStateError
}
// The worst available video quality
type GroupCallVideoQualityThumbnail struct {
meta
}
func (entity *GroupCallVideoQualityThumbnail) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallVideoQualityThumbnail
return json.Marshal((*stub)(entity))
}
func (*GroupCallVideoQualityThumbnail) GetClass() string {
return ClassGroupCallVideoQuality
}
func (*GroupCallVideoQualityThumbnail) GetType() string {
return TypeGroupCallVideoQualityThumbnail
}
func (*GroupCallVideoQualityThumbnail) GroupCallVideoQualityType() string {
return TypeGroupCallVideoQualityThumbnail
}
// The medium video quality
type GroupCallVideoQualityMedium struct {
meta
}
func (entity *GroupCallVideoQualityMedium) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallVideoQualityMedium
return json.Marshal((*stub)(entity))
}
func (*GroupCallVideoQualityMedium) GetClass() string {
return ClassGroupCallVideoQuality
}
func (*GroupCallVideoQualityMedium) GetType() string {
return TypeGroupCallVideoQualityMedium
}
func (*GroupCallVideoQualityMedium) GroupCallVideoQualityType() string {
return TypeGroupCallVideoQualityMedium
}
// The best available video quality
type GroupCallVideoQualityFull struct {
meta
}
func (entity *GroupCallVideoQualityFull) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallVideoQualityFull
return json.Marshal((*stub)(entity))
}
func (*GroupCallVideoQualityFull) GetClass() string {
return ClassGroupCallVideoQuality
}
func (*GroupCallVideoQualityFull) GetType() string {
return TypeGroupCallVideoQualityFull
}
func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string {
return TypeGroupCallVideoQualityFull
}
2023-06-04 22:58:07 +02:00
// Describes an available stream in a group call
type GroupCallStream struct {
meta
// Identifier of an audio/video channel
ChannelId int32 `json:"channel_id"`
// Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds
Scale int32 `json:"scale"`
// Point in time when the stream currently ends; Unix timestamp in milliseconds
TimeOffset int64 `json:"time_offset"`
}
func (entity *GroupCallStream) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallStream
return json.Marshal((*stub)(entity))
}
func (*GroupCallStream) GetClass() string {
return ClassGroupCallStream
}
func (*GroupCallStream) GetType() string {
return TypeGroupCallStream
}
// Represents a list of group call streams
type GroupCallStreams struct {
meta
// A list of group call streams
Streams []*GroupCallStream `json:"streams"`
}
func (entity *GroupCallStreams) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallStreams
return json.Marshal((*stub)(entity))
}
func (*GroupCallStreams) GetClass() string {
return ClassGroupCallStreams
}
func (*GroupCallStreams) GetType() string {
return TypeGroupCallStreams
}
// Represents an RTMP url
type RtmpUrl struct {
meta
// The URL
Url string `json:"url"`
// Stream key
StreamKey string `json:"stream_key"`
}
func (entity *RtmpUrl) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub RtmpUrl
return json.Marshal((*stub)(entity))
}
func (*RtmpUrl) GetClass() string {
return ClassRtmpUrl
}
func (*RtmpUrl) GetType() string {
return TypeRtmpUrl
}
2022-04-18 22:45:01 +02:00
// Describes a recently speaking participant in a group call
type GroupCallRecentSpeaker struct {
meta
// Group call participant identifier
ParticipantId MessageSender `json:"participant_id"`
// True, is the user has spoken recently
IsSpeaking bool `json:"is_speaking"`
}
func (entity *GroupCallRecentSpeaker) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallRecentSpeaker
return json.Marshal((*stub)(entity))
}
func (*GroupCallRecentSpeaker) GetClass() string {
return ClassGroupCallRecentSpeaker
}
func (*GroupCallRecentSpeaker) GetType() string {
return TypeGroupCallRecentSpeaker
}
func (groupCallRecentSpeaker *GroupCallRecentSpeaker) UnmarshalJSON(data []byte) error {
var tmp struct {
ParticipantId json.RawMessage `json:"participant_id"`
IsSpeaking bool `json:"is_speaking"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
groupCallRecentSpeaker.IsSpeaking = tmp.IsSpeaking
fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId)
groupCallRecentSpeaker.ParticipantId = fieldParticipantId
return nil
2021-12-08 10:23:00 +01:00
}
// Describes a group call
type GroupCall struct {
meta
// Group call identifier
Id int32 `json:"id"`
// Group call title
Title string `json:"title"`
// Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended
ScheduledStartDate int32 `json:"scheduled_start_date"`
// True, if the group call is scheduled and the current user will receive a notification when the group call will start
EnabledStartNotification bool `json:"enabled_start_notification"`
// True, if the call is active
IsActive bool `json:"is_active"`
2023-06-04 22:58:07 +02:00
// True, if the chat is an RTMP stream instead of an ordinary video chat
IsRtmpStream bool `json:"is_rtmp_stream"`
2021-12-08 10:23:00 +01:00
// True, if the call is joined
IsJoined bool `json:"is_joined"`
// True, if user was kicked from the call because of network loss and the call needs to be rejoined
NeedRejoin bool `json:"need_rejoin"`
// True, if the current user can manage the group call
CanBeManaged bool `json:"can_be_managed"`
// Number of participants in the group call
ParticipantCount int32 `json:"participant_count"`
2023-06-04 22:58:07 +02:00
// True, if group call participants, which are muted, aren't returned in participant list
HasHiddenListeners bool `json:"has_hidden_listeners"`
2021-12-08 10:23:00 +01:00
// True, if all group call participants are loaded
LoadedAllParticipants bool `json:"loaded_all_participants"`
2022-04-18 22:45:01 +02:00
// At most 3 recently speaking users in the group call
2021-12-08 10:23:00 +01:00
RecentSpeakers []*GroupCallRecentSpeaker `json:"recent_speakers"`
// True, if the current user's video is enabled
IsMyVideoEnabled bool `json:"is_my_video_enabled"`
// True, if the current user's video is paused
IsMyVideoPaused bool `json:"is_my_video_paused"`
// True, if the current user can broadcast video or share screen
CanEnableVideo bool `json:"can_enable_video"`
// True, if only group call administrators can unmute new participants
MuteNewParticipants bool `json:"mute_new_participants"`
// True, if the current user can enable or disable mute_new_participants setting
CanToggleMuteNewParticipants bool `json:"can_toggle_mute_new_participants"`
// Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on
RecordDuration int32 `json:"record_duration"`
// True, if a video file is being recorded for the call
IsVideoRecorded bool `json:"is_video_recorded"`
// Call duration, in seconds; for ended calls only
Duration int32 `json:"duration"`
}
func (entity *GroupCall) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCall
return json.Marshal((*stub)(entity))
}
func (*GroupCall) GetClass() string {
return ClassGroupCall
}
func (*GroupCall) GetType() string {
return TypeGroupCall
}
// Describes a group of video synchronization source identifiers
type GroupCallVideoSourceGroup struct {
meta
// The semantics of sources, one of "SIM" or "FID"
Semantics string `json:"semantics"`
// The list of synchronization source identifiers
SourceIds []int32 `json:"source_ids"`
}
func (entity *GroupCallVideoSourceGroup) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallVideoSourceGroup
return json.Marshal((*stub)(entity))
}
func (*GroupCallVideoSourceGroup) GetClass() string {
return ClassGroupCallVideoSourceGroup
}
func (*GroupCallVideoSourceGroup) GetType() string {
return TypeGroupCallVideoSourceGroup
}
// Contains information about a group call participant's video channel
type GroupCallParticipantVideoInfo struct {
meta
// List of synchronization source groups of the video
SourceGroups []*GroupCallVideoSourceGroup `json:"source_groups"`
// Video channel endpoint identifier
EndpointId string `json:"endpoint_id"`
2023-06-04 22:58:07 +02:00
// True, if the video is paused. This flag needs to be ignored, if new video frames are received
2021-12-08 10:23:00 +01:00
IsPaused bool `json:"is_paused"`
}
func (entity *GroupCallParticipantVideoInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallParticipantVideoInfo
return json.Marshal((*stub)(entity))
}
func (*GroupCallParticipantVideoInfo) GetClass() string {
return ClassGroupCallParticipantVideoInfo
}
func (*GroupCallParticipantVideoInfo) GetType() string {
return TypeGroupCallParticipantVideoInfo
}
// Represents a group call participant
type GroupCallParticipant struct {
meta
// Identifier of the group call participant
ParticipantId MessageSender `json:"participant_id"`
// User's audio channel synchronization source identifier
AudioSourceId int32 `json:"audio_source_id"`
// User's screen sharing audio channel synchronization source identifier
ScreenSharingAudioSourceId int32 `json:"screen_sharing_audio_source_id"`
// Information about user's video channel; may be null if there is no active video
VideoInfo *GroupCallParticipantVideoInfo `json:"video_info"`
// Information about user's screen sharing video channel; may be null if there is no active screen sharing video
ScreenSharingVideoInfo *GroupCallParticipantVideoInfo `json:"screen_sharing_video_info"`
// The participant user's bio or the participant chat's description
Bio string `json:"bio"`
// True, if the participant is the current user
IsCurrentUser bool `json:"is_current_user"`
// True, if the participant is speaking as set by setGroupCallParticipantIsSpeaking
IsSpeaking bool `json:"is_speaking"`
// True, if the participant hand is raised
IsHandRaised bool `json:"is_hand_raised"`
// True, if the current user can mute the participant for all other group call participants
CanBeMutedForAllUsers bool `json:"can_be_muted_for_all_users"`
// True, if the current user can allow the participant to unmute themselves or unmute the participant (if the participant is the current user)
CanBeUnmutedForAllUsers bool `json:"can_be_unmuted_for_all_users"`
// True, if the current user can mute the participant only for self
CanBeMutedForCurrentUser bool `json:"can_be_muted_for_current_user"`
// True, if the current user can unmute the participant for self
CanBeUnmutedForCurrentUser bool `json:"can_be_unmuted_for_current_user"`
// True, if the participant is muted for all users
IsMutedForAllUsers bool `json:"is_muted_for_all_users"`
// True, if the participant is muted for the current user
IsMutedForCurrentUser bool `json:"is_muted_for_current_user"`
// True, if the participant is muted for all users, but can unmute themselves
CanUnmuteSelf bool `json:"can_unmute_self"`
// Participant's volume level; 1-20000 in hundreds of percents
VolumeLevel int32 `json:"volume_level"`
// User's order in the group call participant list. Orders must be compared lexicographically. The bigger is order, the higher is user in the list. If order is empty, the user must be removed from the participant list
Order string `json:"order"`
}
func (entity *GroupCallParticipant) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GroupCallParticipant
return json.Marshal((*stub)(entity))
}
func (*GroupCallParticipant) GetClass() string {
return ClassGroupCallParticipant
}
func (*GroupCallParticipant) GetType() string {
return TypeGroupCallParticipant
}
func (groupCallParticipant *GroupCallParticipant) UnmarshalJSON(data []byte) error {
var tmp struct {
ParticipantId json.RawMessage `json:"participant_id"`
AudioSourceId int32 `json:"audio_source_id"`
ScreenSharingAudioSourceId int32 `json:"screen_sharing_audio_source_id"`
VideoInfo *GroupCallParticipantVideoInfo `json:"video_info"`
ScreenSharingVideoInfo *GroupCallParticipantVideoInfo `json:"screen_sharing_video_info"`
Bio string `json:"bio"`
IsCurrentUser bool `json:"is_current_user"`
IsSpeaking bool `json:"is_speaking"`
IsHandRaised bool `json:"is_hand_raised"`
CanBeMutedForAllUsers bool `json:"can_be_muted_for_all_users"`
CanBeUnmutedForAllUsers bool `json:"can_be_unmuted_for_all_users"`
CanBeMutedForCurrentUser bool `json:"can_be_muted_for_current_user"`
CanBeUnmutedForCurrentUser bool `json:"can_be_unmuted_for_current_user"`
IsMutedForAllUsers bool `json:"is_muted_for_all_users"`
IsMutedForCurrentUser bool `json:"is_muted_for_current_user"`
CanUnmuteSelf bool `json:"can_unmute_self"`
VolumeLevel int32 `json:"volume_level"`
Order string `json:"order"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
groupCallParticipant.AudioSourceId = tmp.AudioSourceId
groupCallParticipant.ScreenSharingAudioSourceId = tmp.ScreenSharingAudioSourceId
groupCallParticipant.VideoInfo = tmp.VideoInfo
groupCallParticipant.ScreenSharingVideoInfo = tmp.ScreenSharingVideoInfo
groupCallParticipant.Bio = tmp.Bio
groupCallParticipant.IsCurrentUser = tmp.IsCurrentUser
groupCallParticipant.IsSpeaking = tmp.IsSpeaking
groupCallParticipant.IsHandRaised = tmp.IsHandRaised
groupCallParticipant.CanBeMutedForAllUsers = tmp.CanBeMutedForAllUsers
groupCallParticipant.CanBeUnmutedForAllUsers = tmp.CanBeUnmutedForAllUsers
groupCallParticipant.CanBeMutedForCurrentUser = tmp.CanBeMutedForCurrentUser
groupCallParticipant.CanBeUnmutedForCurrentUser = tmp.CanBeUnmutedForCurrentUser
groupCallParticipant.IsMutedForAllUsers = tmp.IsMutedForAllUsers
groupCallParticipant.IsMutedForCurrentUser = tmp.IsMutedForCurrentUser
groupCallParticipant.CanUnmuteSelf = tmp.CanUnmuteSelf
groupCallParticipant.VolumeLevel = tmp.VolumeLevel
groupCallParticipant.Order = tmp.Order
fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId)
groupCallParticipant.ParticipantId = fieldParticipantId
return nil
}
// The user heard their own voice
type CallProblemEcho struct {
meta
}
func (entity *CallProblemEcho) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallProblemEcho
return json.Marshal((*stub)(entity))
}
func (*CallProblemEcho) GetClass() string {
return ClassCallProblem
}
func (*CallProblemEcho) GetType() string {
return TypeCallProblemEcho
}
func (*CallProblemEcho) CallProblemType() string {
return TypeCallProblemEcho
}
// The user heard background noise
type CallProblemNoise struct {
meta
}
func (entity *CallProblemNoise) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallProblemNoise
return json.Marshal((*stub)(entity))
}
func (*CallProblemNoise) GetClass() string {
return ClassCallProblem
}
func (*CallProblemNoise) GetType() string {
return TypeCallProblemNoise
}
func (*CallProblemNoise) CallProblemType() string {
return TypeCallProblemNoise
}
// The other side kept disappearing
type CallProblemInterruptions struct {
meta
}
func (entity *CallProblemInterruptions) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallProblemInterruptions
return json.Marshal((*stub)(entity))
}
func (*CallProblemInterruptions) GetClass() string {
return ClassCallProblem
}
func (*CallProblemInterruptions) GetType() string {
return TypeCallProblemInterruptions
}
func (*CallProblemInterruptions) CallProblemType() string {
return TypeCallProblemInterruptions
}
// The speech was distorted
type CallProblemDistortedSpeech struct {
meta
}
func (entity *CallProblemDistortedSpeech) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallProblemDistortedSpeech
return json.Marshal((*stub)(entity))
}
func (*CallProblemDistortedSpeech) GetClass() string {
return ClassCallProblem
}
func (*CallProblemDistortedSpeech) GetType() string {
return TypeCallProblemDistortedSpeech
}
func (*CallProblemDistortedSpeech) CallProblemType() string {
return TypeCallProblemDistortedSpeech
}
// The user couldn't hear the other side
type CallProblemSilentLocal struct {
meta
}
func (entity *CallProblemSilentLocal) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallProblemSilentLocal
return json.Marshal((*stub)(entity))
}
func (*CallProblemSilentLocal) GetClass() string {
return ClassCallProblem
}
func (*CallProblemSilentLocal) GetType() string {
return TypeCallProblemSilentLocal
}
func (*CallProblemSilentLocal) CallProblemType() string {
return TypeCallProblemSilentLocal
}
// The other side couldn't hear the user
type CallProblemSilentRemote struct {
meta
}
func (entity *CallProblemSilentRemote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallProblemSilentRemote
return json.Marshal((*stub)(entity))
}
func (*CallProblemSilentRemote) GetClass() string {
return ClassCallProblem
}
func (*CallProblemSilentRemote) GetType() string {
return TypeCallProblemSilentRemote
}
func (*CallProblemSilentRemote) CallProblemType() string {
return TypeCallProblemSilentRemote
}
// The call ended unexpectedly
type CallProblemDropped struct {
meta
}
func (entity *CallProblemDropped) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallProblemDropped
return json.Marshal((*stub)(entity))
}
func (*CallProblemDropped) GetClass() string {
return ClassCallProblem
}
func (*CallProblemDropped) GetType() string {
return TypeCallProblemDropped
}
func (*CallProblemDropped) CallProblemType() string {
return TypeCallProblemDropped
}
// The video was distorted
type CallProblemDistortedVideo struct {
meta
}
func (entity *CallProblemDistortedVideo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallProblemDistortedVideo
return json.Marshal((*stub)(entity))
}
func (*CallProblemDistortedVideo) GetClass() string {
return ClassCallProblem
}
func (*CallProblemDistortedVideo) GetType() string {
return TypeCallProblemDistortedVideo
}
func (*CallProblemDistortedVideo) CallProblemType() string {
return TypeCallProblemDistortedVideo
}
// The video was pixelated
type CallProblemPixelatedVideo struct {
meta
}
func (entity *CallProblemPixelatedVideo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallProblemPixelatedVideo
return json.Marshal((*stub)(entity))
}
func (*CallProblemPixelatedVideo) GetClass() string {
return ClassCallProblem
}
func (*CallProblemPixelatedVideo) GetType() string {
return TypeCallProblemPixelatedVideo
}
func (*CallProblemPixelatedVideo) CallProblemType() string {
return TypeCallProblemPixelatedVideo
}
// Describes a call
type Call struct {
meta
// Call identifier, not persistent
Id int32 `json:"id"`
// Peer user identifier
UserId int64 `json:"user_id"`
// True, if the call is outgoing
IsOutgoing bool `json:"is_outgoing"`
// True, if the call is a video call
IsVideo bool `json:"is_video"`
// Call state
State CallState `json:"state"`
}
func (entity *Call) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Call
return json.Marshal((*stub)(entity))
}
func (*Call) GetClass() string {
return ClassCall
}
func (*Call) GetType() string {
return TypeCall
}
func (call *Call) UnmarshalJSON(data []byte) error {
var tmp struct {
Id int32 `json:"id"`
UserId int64 `json:"user_id"`
IsOutgoing bool `json:"is_outgoing"`
IsVideo bool `json:"is_video"`
State json.RawMessage `json:"state"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
call.Id = tmp.Id
call.UserId = tmp.UserId
call.IsOutgoing = tmp.IsOutgoing
call.IsVideo = tmp.IsVideo
fieldState, _ := UnmarshalCallState(tmp.State)
call.State = fieldState
return nil
}
// Contains settings for the authentication of the user's phone number
type PhoneNumberAuthenticationSettings struct {
meta
// Pass true if the authentication code may be sent via a flash call to the specified phone number
AllowFlashCall bool `json:"allow_flash_call"`
// Pass true if the authentication code may be sent via a missed call to the specified phone number
AllowMissedCall bool `json:"allow_missed_call"`
// Pass true if the authenticated phone number is used on the current device
IsCurrentPhoneNumber bool `json:"is_current_phone_number"`
// For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details
AllowSmsRetrieverApi bool `json:"allow_sms_retriever_api"`
2022-04-18 22:45:01 +02:00
// List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions
2021-12-08 10:23:00 +01:00
AuthenticationTokens []string `json:"authentication_tokens"`
}
func (entity *PhoneNumberAuthenticationSettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PhoneNumberAuthenticationSettings
return json.Marshal((*stub)(entity))
}
func (*PhoneNumberAuthenticationSettings) GetClass() string {
return ClassPhoneNumberAuthenticationSettings
}
func (*PhoneNumberAuthenticationSettings) GetType() string {
return TypePhoneNumberAuthenticationSettings
}
2023-06-04 22:58:07 +02:00
// Represents a reaction applied to a message
type AddedReaction struct {
2022-04-18 22:45:01 +02:00
meta
2023-06-04 22:58:07 +02:00
// Type of the reaction
Type ReactionType `json:"type"`
// Identifier of the chat member, applied the reaction
SenderId MessageSender `json:"sender_id"`
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *AddedReaction) MarshalJSON() ([]byte, error) {
2022-04-18 22:45:01 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub AddedReaction
2022-04-18 22:45:01 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*AddedReaction) GetClass() string {
return ClassAddedReaction
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
func (*AddedReaction) GetType() string {
return TypeAddedReaction
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
func (addedReaction *AddedReaction) UnmarshalJSON(data []byte) error {
var tmp struct {
Type json.RawMessage `json:"type"`
SenderId json.RawMessage `json:"sender_id"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldType, _ := UnmarshalReactionType(tmp.Type)
addedReaction.Type = fieldType
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
addedReaction.SenderId = fieldSenderId
return nil
}
// Represents a list of reactions added to a message
type AddedReactions struct {
2022-04-18 22:45:01 +02:00
meta
2023-06-04 22:58:07 +02:00
// The total number of found reactions
TotalCount int32 `json:"total_count"`
// The list of added reactions
Reactions []*AddedReaction `json:"reactions"`
// The offset for the next request. If empty, there are no more results
NextOffset string `json:"next_offset"`
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *AddedReactions) MarshalJSON() ([]byte, error) {
2022-04-18 22:45:01 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub AddedReactions
2022-04-18 22:45:01 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*AddedReactions) GetClass() string {
return ClassAddedReactions
2023-06-04 22:53:18 +02:00
}
2023-06-04 22:58:07 +02:00
func (*AddedReactions) GetType() string {
return TypeAddedReactions
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents an available reaction
type AvailableReaction struct {
meta
// Type of the reaction
Type ReactionType `json:"type"`
// True, if Telegram Premium is needed to send the reaction
NeedsPremium bool `json:"needs_premium"`
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *AvailableReaction) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AvailableReaction
return json.Marshal((*stub)(entity))
}
func (*AvailableReaction) GetClass() string {
return ClassAvailableReaction
}
func (*AvailableReaction) GetType() string {
return TypeAvailableReaction
}
func (availableReaction *AvailableReaction) UnmarshalJSON(data []byte) error {
var tmp struct {
Type json.RawMessage `json:"type"`
NeedsPremium bool `json:"needs_premium"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
availableReaction.NeedsPremium = tmp.NeedsPremium
fieldType, _ := UnmarshalReactionType(tmp.Type)
availableReaction.Type = fieldType
return nil
}
// Represents a list of reactions that can be added to a message
type AvailableReactions struct {
meta
// List of reactions to be shown at the top
TopReactions []*AvailableReaction `json:"top_reactions"`
// List of recently used reactions
RecentReactions []*AvailableReaction `json:"recent_reactions"`
// List of popular reactions
PopularReactions []*AvailableReaction `json:"popular_reactions"`
// True, if custom emoji reactions could be added by Telegram Premium subscribers
AllowCustomEmoji bool `json:"allow_custom_emoji"`
}
func (entity *AvailableReactions) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AvailableReactions
return json.Marshal((*stub)(entity))
}
func (*AvailableReactions) GetClass() string {
return ClassAvailableReactions
}
func (*AvailableReactions) GetType() string {
return TypeAvailableReactions
}
// Contains information about a emoji reaction
type EmojiReaction struct {
meta
// Text representation of the reaction
Emoji string `json:"emoji"`
// Reaction title
Title string `json:"title"`
// True, if the reaction can be added to new messages and enabled in chats
IsActive bool `json:"is_active"`
// Static icon for the reaction
StaticIcon *Sticker `json:"static_icon"`
// Appear animation for the reaction
AppearAnimation *Sticker `json:"appear_animation"`
// Select animation for the reaction
SelectAnimation *Sticker `json:"select_animation"`
// Activate animation for the reaction
ActivateAnimation *Sticker `json:"activate_animation"`
// Effect animation for the reaction
EffectAnimation *Sticker `json:"effect_animation"`
// Around animation for the reaction; may be null
AroundAnimation *Sticker `json:"around_animation"`
// Center animation for the reaction; may be null
CenterAnimation *Sticker `json:"center_animation"`
}
func (entity *EmojiReaction) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub EmojiReaction
return json.Marshal((*stub)(entity))
}
func (*EmojiReaction) GetClass() string {
return ClassEmojiReaction
}
func (*EmojiReaction) GetType() string {
return TypeEmojiReaction
}
// Represents a list of animations
type Animations struct {
meta
// List of animations
Animations []*Animation `json:"animations"`
}
func (entity *Animations) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Animations
return json.Marshal((*stub)(entity))
}
func (*Animations) GetClass() string {
return ClassAnimations
}
func (*Animations) GetType() string {
return TypeAnimations
}
// A regular animated sticker
type DiceStickersRegular struct {
meta
// The animated sticker with the dice animation
Sticker *Sticker `json:"sticker"`
}
func (entity *DiceStickersRegular) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DiceStickersRegular
return json.Marshal((*stub)(entity))
}
func (*DiceStickersRegular) GetClass() string {
return ClassDiceStickers
}
func (*DiceStickersRegular) GetType() string {
return TypeDiceStickersRegular
}
func (*DiceStickersRegular) DiceStickersType() string {
return TypeDiceStickersRegular
}
// Animated stickers to be combined into a slot machine
type DiceStickersSlotMachine struct {
meta
// The animated sticker with the slot machine background. The background animation must start playing after all reel animations finish
Background *Sticker `json:"background"`
// The animated sticker with the lever animation. The lever animation must play once in the initial dice state
Lever *Sticker `json:"lever"`
2023-06-04 22:53:18 +02:00
// The animated sticker with the left reel
LeftReel *Sticker `json:"left_reel"`
// The animated sticker with the center reel
CenterReel *Sticker `json:"center_reel"`
// The animated sticker with the right reel
RightReel *Sticker `json:"right_reel"`
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:53:18 +02:00
func (entity *DiceStickersSlotMachine) MarshalJSON() ([]byte, error) {
2022-04-18 22:45:01 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:53:18 +02:00
type stub DiceStickersSlotMachine
2022-04-18 22:45:01 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:53:18 +02:00
func (*DiceStickersSlotMachine) GetClass() string {
return ClassDiceStickers
2021-12-08 10:23:00 +01:00
}
func (*DiceStickersSlotMachine) GetType() string {
return TypeDiceStickersSlotMachine
}
func (*DiceStickersSlotMachine) DiceStickersType() string {
return TypeDiceStickersSlotMachine
}
2023-06-04 22:58:07 +02:00
// Represents the result of an importContacts request
2021-12-08 10:23:00 +01:00
type ImportedContacts struct {
meta
// User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user
UserIds []int64 `json:"user_ids"`
// The number of users that imported the corresponding contact; 0 for already registered users or if unavailable
ImporterCount []int32 `json:"importer_count"`
}
func (entity *ImportedContacts) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ImportedContacts
return json.Marshal((*stub)(entity))
}
func (*ImportedContacts) GetClass() string {
return ClassImportedContacts
}
func (*ImportedContacts) GetType() string {
return TypeImportedContacts
}
2023-06-04 22:58:07 +02:00
// The speech recognition is ongoing
type SpeechRecognitionResultPending struct {
meta
// Partially recognized text
PartialText string `json:"partial_text"`
}
func (entity *SpeechRecognitionResultPending) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SpeechRecognitionResultPending
return json.Marshal((*stub)(entity))
}
func (*SpeechRecognitionResultPending) GetClass() string {
return ClassSpeechRecognitionResult
}
func (*SpeechRecognitionResultPending) GetType() string {
return TypeSpeechRecognitionResultPending
}
func (*SpeechRecognitionResultPending) SpeechRecognitionResultType() string {
return TypeSpeechRecognitionResultPending
}
// The speech recognition successfully finished
type SpeechRecognitionResultText struct {
meta
// Recognized text
Text string `json:"text"`
}
func (entity *SpeechRecognitionResultText) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SpeechRecognitionResultText
return json.Marshal((*stub)(entity))
}
func (*SpeechRecognitionResultText) GetClass() string {
return ClassSpeechRecognitionResult
}
func (*SpeechRecognitionResultText) GetType() string {
return TypeSpeechRecognitionResultText
}
func (*SpeechRecognitionResultText) SpeechRecognitionResultType() string {
return TypeSpeechRecognitionResultText
}
// The speech recognition failed
type SpeechRecognitionResultError struct {
meta
// Received error
Error *Error `json:"error"`
}
func (entity *SpeechRecognitionResultError) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SpeechRecognitionResultError
return json.Marshal((*stub)(entity))
}
func (*SpeechRecognitionResultError) GetClass() string {
return ClassSpeechRecognitionResult
}
func (*SpeechRecognitionResultError) GetType() string {
return TypeSpeechRecognitionResultError
}
func (*SpeechRecognitionResultError) SpeechRecognitionResultType() string {
return TypeSpeechRecognitionResultError
}
// Describes a color to highlight a bot added to attachment menu
type AttachmentMenuBotColor struct {
meta
// Color in the RGB24 format for light themes
LightColor int32 `json:"light_color"`
// Color in the RGB24 format for dark themes
DarkColor int32 `json:"dark_color"`
}
func (entity *AttachmentMenuBotColor) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AttachmentMenuBotColor
return json.Marshal((*stub)(entity))
}
func (*AttachmentMenuBotColor) GetClass() string {
return ClassAttachmentMenuBotColor
}
func (*AttachmentMenuBotColor) GetType() string {
return TypeAttachmentMenuBotColor
}
// Represents a bot, which can be added to attachment menu
type AttachmentMenuBot struct {
meta
// User identifier of the bot added to attachment menu
BotUserId int64 `json:"bot_user_id"`
// True, if the bot supports opening from attachment menu in the chat with the bot
SupportsSelfChat bool `json:"supports_self_chat"`
// True, if the bot supports opening from attachment menu in private chats with ordinary users
SupportsUserChats bool `json:"supports_user_chats"`
// True, if the bot supports opening from attachment menu in private chats with other bots
SupportsBotChats bool `json:"supports_bot_chats"`
// True, if the bot supports opening from attachment menu in basic group and supergroup chats
SupportsGroupChats bool `json:"supports_group_chats"`
// True, if the bot supports opening from attachment menu in channel chats
SupportsChannelChats bool `json:"supports_channel_chats"`
// True, if the bot supports "settings_button_pressed" event
SupportsSettings bool `json:"supports_settings"`
// True, if the user needs to be requested to give the permission to the bot to send them messages
RequestWriteAccess bool `json:"request_write_access"`
// Name for the bot in attachment menu
Name string `json:"name"`
// Color to highlight selected name of the bot if appropriate; may be null
NameColor *AttachmentMenuBotColor `json:"name_color"`
// Default attachment menu icon for the bot in SVG format; may be null
DefaultIcon *File `json:"default_icon"`
// Attachment menu icon for the bot in SVG format for the official iOS app; may be null
IosStaticIcon *File `json:"ios_static_icon"`
// Attachment menu icon for the bot in TGS format for the official iOS app; may be null
IosAnimatedIcon *File `json:"ios_animated_icon"`
// Attachment menu icon for the bot in TGS format for the official Android app; may be null
AndroidIcon *File `json:"android_icon"`
// Attachment menu icon for the bot in TGS format for the official native macOS app; may be null
MacosIcon *File `json:"macos_icon"`
// Color to highlight selected icon of the bot if appropriate; may be null
IconColor *AttachmentMenuBotColor `json:"icon_color"`
// Default placeholder for opened Web Apps in SVG format; may be null
WebAppPlaceholder *File `json:"web_app_placeholder"`
}
func (entity *AttachmentMenuBot) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AttachmentMenuBot
return json.Marshal((*stub)(entity))
}
func (*AttachmentMenuBot) GetClass() string {
return ClassAttachmentMenuBot
}
func (*AttachmentMenuBot) GetType() string {
return TypeAttachmentMenuBot
}
// Information about the message sent by answerWebAppQuery
type SentWebAppMessage struct {
meta
// Identifier of the sent inline message, if known
InlineMessageId string `json:"inline_message_id"`
}
func (entity *SentWebAppMessage) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SentWebAppMessage
return json.Marshal((*stub)(entity))
}
func (*SentWebAppMessage) GetClass() string {
return ClassSentWebAppMessage
}
func (*SentWebAppMessage) GetType() string {
return TypeSentWebAppMessage
}
2021-12-08 10:23:00 +01:00
// Contains an HTTP URL
type HttpUrl struct {
meta
// The URL
Url string `json:"url"`
}
func (entity *HttpUrl) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub HttpUrl
return json.Marshal((*stub)(entity))
}
func (*HttpUrl) GetClass() string {
return ClassHttpUrl
}
func (*HttpUrl) GetType() string {
return TypeHttpUrl
}
2023-06-04 22:58:07 +02:00
// Contains an HTTPS URL, which can be used to get information about a user
type UserLink struct {
meta
// The URL
Url string `json:"url"`
// Left time for which the link is valid, in seconds; 0 if the link is a public username link
ExpiresIn int32 `json:"expires_in"`
}
func (entity *UserLink) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UserLink
return json.Marshal((*stub)(entity))
}
func (*UserLink) GetClass() string {
return ClassUserLink
}
func (*UserLink) GetType() string {
return TypeUserLink
}
2021-12-08 10:23:00 +01:00
// Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video
type InputInlineQueryResultAnimation struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the query result
Title string `json:"title"`
// URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// MIME type of the video thumbnail. If non-empty, must be one of "image/jpeg", "image/gif" and "video/mp4"
ThumbnailMimeType string `json:"thumbnail_mime_type"`
// The URL of the video file (file size must not exceed 1MB)
VideoUrl string `json:"video_url"`
// MIME type of the video file. Must be one of "image/gif" and "video/mp4"
VideoMimeType string `json:"video_mime_type"`
// Duration of the video, in seconds
VideoDuration int32 `json:"video_duration"`
// Width of the video
VideoWidth int32 `json:"video_width"`
// Height of the video
VideoHeight int32 `json:"video_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
}
func (entity *InputInlineQueryResultAnimation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultAnimation
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultAnimation) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultAnimation) GetType() string {
return TypeInputInlineQueryResultAnimation
}
func (*InputInlineQueryResultAnimation) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultAnimation
}
func (inputInlineQueryResultAnimation *InputInlineQueryResultAnimation) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailMimeType string `json:"thumbnail_mime_type"`
VideoUrl string `json:"video_url"`
VideoMimeType string `json:"video_mime_type"`
VideoDuration int32 `json:"video_duration"`
VideoWidth int32 `json:"video_width"`
VideoHeight int32 `json:"video_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultAnimation.Id = tmp.Id
inputInlineQueryResultAnimation.Title = tmp.Title
inputInlineQueryResultAnimation.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultAnimation.ThumbnailMimeType = tmp.ThumbnailMimeType
inputInlineQueryResultAnimation.VideoUrl = tmp.VideoUrl
inputInlineQueryResultAnimation.VideoMimeType = tmp.VideoMimeType
inputInlineQueryResultAnimation.VideoDuration = tmp.VideoDuration
inputInlineQueryResultAnimation.VideoWidth = tmp.VideoWidth
inputInlineQueryResultAnimation.VideoHeight = tmp.VideoHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultAnimation.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultAnimation.InputMessageContent = fieldInputMessageContent
return nil
}
// Represents a link to an article or web page
type InputInlineQueryResultArticle struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// URL of the result, if it exists
Url string `json:"url"`
// True, if the URL must be not shown
HideUrl bool `json:"hide_url"`
// Title of the result
Title string `json:"title"`
// A short description of the result
Description string `json:"description"`
// URL of the result thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// Thumbnail width, if known
ThumbnailWidth int32 `json:"thumbnail_width"`
// Thumbnail height, if known
ThumbnailHeight int32 `json:"thumbnail_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
}
func (entity *InputInlineQueryResultArticle) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultArticle
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultArticle) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultArticle) GetType() string {
return TypeInputInlineQueryResultArticle
}
func (*InputInlineQueryResultArticle) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultArticle
}
func (inputInlineQueryResultArticle *InputInlineQueryResultArticle) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
Url string `json:"url"`
HideUrl bool `json:"hide_url"`
Title string `json:"title"`
Description string `json:"description"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailWidth int32 `json:"thumbnail_width"`
ThumbnailHeight int32 `json:"thumbnail_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultArticle.Id = tmp.Id
inputInlineQueryResultArticle.Url = tmp.Url
inputInlineQueryResultArticle.HideUrl = tmp.HideUrl
inputInlineQueryResultArticle.Title = tmp.Title
inputInlineQueryResultArticle.Description = tmp.Description
inputInlineQueryResultArticle.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultArticle.ThumbnailWidth = tmp.ThumbnailWidth
inputInlineQueryResultArticle.ThumbnailHeight = tmp.ThumbnailHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultArticle.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultArticle.InputMessageContent = fieldInputMessageContent
return nil
}
// Represents a link to an MP3 audio file
type InputInlineQueryResultAudio struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the audio file
Title string `json:"title"`
// Performer of the audio file
Performer string `json:"performer"`
// The URL of the audio file
AudioUrl string `json:"audio_url"`
// Audio file duration, in seconds
AudioDuration int32 `json:"audio_duration"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAudio, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
}
func (entity *InputInlineQueryResultAudio) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultAudio
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultAudio) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultAudio) GetType() string {
return TypeInputInlineQueryResultAudio
}
func (*InputInlineQueryResultAudio) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultAudio
}
func (inputInlineQueryResultAudio *InputInlineQueryResultAudio) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
Performer string `json:"performer"`
AudioUrl string `json:"audio_url"`
AudioDuration int32 `json:"audio_duration"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultAudio.Id = tmp.Id
inputInlineQueryResultAudio.Title = tmp.Title
inputInlineQueryResultAudio.Performer = tmp.Performer
inputInlineQueryResultAudio.AudioUrl = tmp.AudioUrl
inputInlineQueryResultAudio.AudioDuration = tmp.AudioDuration
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultAudio.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultAudio.InputMessageContent = fieldInputMessageContent
return nil
}
// Represents a user contact
type InputInlineQueryResultContact struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// User contact
Contact *Contact `json:"contact"`
// URL of the result thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// Thumbnail width, if known
ThumbnailWidth int32 `json:"thumbnail_width"`
// Thumbnail height, if known
ThumbnailHeight int32 `json:"thumbnail_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
}
func (entity *InputInlineQueryResultContact) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultContact
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultContact) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultContact) GetType() string {
return TypeInputInlineQueryResultContact
}
func (*InputInlineQueryResultContact) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultContact
}
func (inputInlineQueryResultContact *InputInlineQueryResultContact) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
Contact *Contact `json:"contact"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailWidth int32 `json:"thumbnail_width"`
ThumbnailHeight int32 `json:"thumbnail_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultContact.Id = tmp.Id
inputInlineQueryResultContact.Contact = tmp.Contact
inputInlineQueryResultContact.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultContact.ThumbnailWidth = tmp.ThumbnailWidth
inputInlineQueryResultContact.ThumbnailHeight = tmp.ThumbnailHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultContact.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultContact.InputMessageContent = fieldInputMessageContent
return nil
}
// Represents a link to a file
type InputInlineQueryResultDocument struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the resulting file
Title string `json:"title"`
// Short description of the result, if known
Description string `json:"description"`
// URL of the file
DocumentUrl string `json:"document_url"`
// MIME type of the file content; only "application/pdf" and "application/zip" are currently allowed
MimeType string `json:"mime_type"`
// The URL of the file thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// Width of the thumbnail
ThumbnailWidth int32 `json:"thumbnail_width"`
// Height of the thumbnail
ThumbnailHeight int32 `json:"thumbnail_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageDocument, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
}
func (entity *InputInlineQueryResultDocument) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultDocument
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultDocument) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultDocument) GetType() string {
return TypeInputInlineQueryResultDocument
}
func (*InputInlineQueryResultDocument) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultDocument
}
func (inputInlineQueryResultDocument *InputInlineQueryResultDocument) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
DocumentUrl string `json:"document_url"`
MimeType string `json:"mime_type"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailWidth int32 `json:"thumbnail_width"`
ThumbnailHeight int32 `json:"thumbnail_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultDocument.Id = tmp.Id
inputInlineQueryResultDocument.Title = tmp.Title
inputInlineQueryResultDocument.Description = tmp.Description
inputInlineQueryResultDocument.DocumentUrl = tmp.DocumentUrl
inputInlineQueryResultDocument.MimeType = tmp.MimeType
inputInlineQueryResultDocument.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultDocument.ThumbnailWidth = tmp.ThumbnailWidth
inputInlineQueryResultDocument.ThumbnailHeight = tmp.ThumbnailHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultDocument.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultDocument.InputMessageContent = fieldInputMessageContent
return nil
}
// Represents a game
type InputInlineQueryResultGame struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Short name of the game
GameShortName string `json:"game_short_name"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
}
func (entity *InputInlineQueryResultGame) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultGame
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultGame) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultGame) GetType() string {
return TypeInputInlineQueryResultGame
}
func (*InputInlineQueryResultGame) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultGame
}
func (inputInlineQueryResultGame *InputInlineQueryResultGame) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
GameShortName string `json:"game_short_name"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultGame.Id = tmp.Id
inputInlineQueryResultGame.GameShortName = tmp.GameShortName
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultGame.ReplyMarkup = fieldReplyMarkup
return nil
}
// Represents a point on the map
type InputInlineQueryResultLocation struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Location result
Location *Location `json:"location"`
// Amount of time relative to the message sent time until the location can be updated, in seconds
LivePeriod int32 `json:"live_period"`
// Title of the result
Title string `json:"title"`
// URL of the result thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// Thumbnail width, if known
ThumbnailWidth int32 `json:"thumbnail_width"`
// Thumbnail height, if known
ThumbnailHeight int32 `json:"thumbnail_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
}
func (entity *InputInlineQueryResultLocation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultLocation
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultLocation) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultLocation) GetType() string {
return TypeInputInlineQueryResultLocation
}
func (*InputInlineQueryResultLocation) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultLocation
}
func (inputInlineQueryResultLocation *InputInlineQueryResultLocation) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
Location *Location `json:"location"`
LivePeriod int32 `json:"live_period"`
Title string `json:"title"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailWidth int32 `json:"thumbnail_width"`
ThumbnailHeight int32 `json:"thumbnail_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultLocation.Id = tmp.Id
inputInlineQueryResultLocation.Location = tmp.Location
inputInlineQueryResultLocation.LivePeriod = tmp.LivePeriod
inputInlineQueryResultLocation.Title = tmp.Title
inputInlineQueryResultLocation.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultLocation.ThumbnailWidth = tmp.ThumbnailWidth
inputInlineQueryResultLocation.ThumbnailHeight = tmp.ThumbnailHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultLocation.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultLocation.InputMessageContent = fieldInputMessageContent
return nil
}
// Represents link to a JPEG image
type InputInlineQueryResultPhoto struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the result, if known
Title string `json:"title"`
// A short description of the result, if known
Description string `json:"description"`
// URL of the photo thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// The URL of the JPEG photo (photo size must not exceed 5MB)
PhotoUrl string `json:"photo_url"`
// Width of the photo
PhotoWidth int32 `json:"photo_width"`
// Height of the photo
PhotoHeight int32 `json:"photo_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
}
func (entity *InputInlineQueryResultPhoto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultPhoto
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultPhoto) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultPhoto) GetType() string {
return TypeInputInlineQueryResultPhoto
}
func (*InputInlineQueryResultPhoto) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultPhoto
}
func (inputInlineQueryResultPhoto *InputInlineQueryResultPhoto) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
ThumbnailUrl string `json:"thumbnail_url"`
PhotoUrl string `json:"photo_url"`
PhotoWidth int32 `json:"photo_width"`
PhotoHeight int32 `json:"photo_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultPhoto.Id = tmp.Id
inputInlineQueryResultPhoto.Title = tmp.Title
inputInlineQueryResultPhoto.Description = tmp.Description
inputInlineQueryResultPhoto.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultPhoto.PhotoUrl = tmp.PhotoUrl
inputInlineQueryResultPhoto.PhotoWidth = tmp.PhotoWidth
inputInlineQueryResultPhoto.PhotoHeight = tmp.PhotoHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultPhoto.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultPhoto.InputMessageContent = fieldInputMessageContent
return nil
}
2023-06-04 22:58:07 +02:00
// Represents a link to a WEBP, TGS, or WEBM sticker
2021-12-08 10:23:00 +01:00
type InputInlineQueryResultSticker struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// URL of the sticker thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
2023-06-04 22:58:07 +02:00
// The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB)
2021-12-08 10:23:00 +01:00
StickerUrl string `json:"sticker_url"`
// Width of the sticker
StickerWidth int32 `json:"sticker_width"`
// Height of the sticker
StickerHeight int32 `json:"sticker_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
}
func (entity *InputInlineQueryResultSticker) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultSticker
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultSticker) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultSticker) GetType() string {
return TypeInputInlineQueryResultSticker
}
func (*InputInlineQueryResultSticker) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultSticker
}
func (inputInlineQueryResultSticker *InputInlineQueryResultSticker) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
ThumbnailUrl string `json:"thumbnail_url"`
StickerUrl string `json:"sticker_url"`
StickerWidth int32 `json:"sticker_width"`
StickerHeight int32 `json:"sticker_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultSticker.Id = tmp.Id
inputInlineQueryResultSticker.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultSticker.StickerUrl = tmp.StickerUrl
inputInlineQueryResultSticker.StickerWidth = tmp.StickerWidth
inputInlineQueryResultSticker.StickerHeight = tmp.StickerHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultSticker.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultSticker.InputMessageContent = fieldInputMessageContent
return nil
}
// Represents information about a venue
type InputInlineQueryResultVenue struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Venue result
Venue *Venue `json:"venue"`
// URL of the result thumbnail, if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// Thumbnail width, if known
ThumbnailWidth int32 `json:"thumbnail_width"`
// Thumbnail height, if known
ThumbnailHeight int32 `json:"thumbnail_height"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
}
func (entity *InputInlineQueryResultVenue) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultVenue
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultVenue) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultVenue) GetType() string {
return TypeInputInlineQueryResultVenue
}
func (*InputInlineQueryResultVenue) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultVenue
}
func (inputInlineQueryResultVenue *InputInlineQueryResultVenue) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
Venue *Venue `json:"venue"`
ThumbnailUrl string `json:"thumbnail_url"`
ThumbnailWidth int32 `json:"thumbnail_width"`
ThumbnailHeight int32 `json:"thumbnail_height"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultVenue.Id = tmp.Id
inputInlineQueryResultVenue.Venue = tmp.Venue
inputInlineQueryResultVenue.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultVenue.ThumbnailWidth = tmp.ThumbnailWidth
inputInlineQueryResultVenue.ThumbnailHeight = tmp.ThumbnailHeight
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultVenue.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultVenue.InputMessageContent = fieldInputMessageContent
return nil
}
// Represents a link to a page containing an embedded video player or a video file
type InputInlineQueryResultVideo struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the result
Title string `json:"title"`
// A short description of the result, if known
Description string `json:"description"`
// The URL of the video thumbnail (JPEG), if it exists
ThumbnailUrl string `json:"thumbnail_url"`
// URL of the embedded video player or video file
VideoUrl string `json:"video_url"`
// MIME type of the content of the video URL, only "text/html" or "video/mp4" are currently supported
MimeType string `json:"mime_type"`
// Width of the video
VideoWidth int32 `json:"video_width"`
// Height of the video
VideoHeight int32 `json:"video_height"`
// Video duration, in seconds
VideoDuration int32 `json:"video_duration"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVideo, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
}
func (entity *InputInlineQueryResultVideo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultVideo
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultVideo) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultVideo) GetType() string {
return TypeInputInlineQueryResultVideo
}
func (*InputInlineQueryResultVideo) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultVideo
}
func (inputInlineQueryResultVideo *InputInlineQueryResultVideo) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
ThumbnailUrl string `json:"thumbnail_url"`
VideoUrl string `json:"video_url"`
MimeType string `json:"mime_type"`
VideoWidth int32 `json:"video_width"`
VideoHeight int32 `json:"video_height"`
VideoDuration int32 `json:"video_duration"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultVideo.Id = tmp.Id
inputInlineQueryResultVideo.Title = tmp.Title
inputInlineQueryResultVideo.Description = tmp.Description
inputInlineQueryResultVideo.ThumbnailUrl = tmp.ThumbnailUrl
inputInlineQueryResultVideo.VideoUrl = tmp.VideoUrl
inputInlineQueryResultVideo.MimeType = tmp.MimeType
inputInlineQueryResultVideo.VideoWidth = tmp.VideoWidth
inputInlineQueryResultVideo.VideoHeight = tmp.VideoHeight
inputInlineQueryResultVideo.VideoDuration = tmp.VideoDuration
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultVideo.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultVideo.InputMessageContent = fieldInputMessageContent
return nil
}
// Represents a link to an opus-encoded audio file within an OGG container, single channel audio
type InputInlineQueryResultVoiceNote struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Title of the voice note
Title string `json:"title"`
// The URL of the voice note file
VoiceNoteUrl string `json:"voice_note_url"`
// Duration of the voice note, in seconds
VoiceNoteDuration int32 `json:"voice_note_duration"`
// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVoiceNote, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
InputMessageContent InputMessageContent `json:"input_message_content"`
}
func (entity *InputInlineQueryResultVoiceNote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputInlineQueryResultVoiceNote
return json.Marshal((*stub)(entity))
}
func (*InputInlineQueryResultVoiceNote) GetClass() string {
return ClassInputInlineQueryResult
}
func (*InputInlineQueryResultVoiceNote) GetType() string {
return TypeInputInlineQueryResultVoiceNote
}
func (*InputInlineQueryResultVoiceNote) InputInlineQueryResultType() string {
return TypeInputInlineQueryResultVoiceNote
}
func (inputInlineQueryResultVoiceNote *InputInlineQueryResultVoiceNote) UnmarshalJSON(data []byte) error {
var tmp struct {
Id string `json:"id"`
Title string `json:"title"`
VoiceNoteUrl string `json:"voice_note_url"`
VoiceNoteDuration int32 `json:"voice_note_duration"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
InputMessageContent json.RawMessage `json:"input_message_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inputInlineQueryResultVoiceNote.Id = tmp.Id
inputInlineQueryResultVoiceNote.Title = tmp.Title
inputInlineQueryResultVoiceNote.VoiceNoteUrl = tmp.VoiceNoteUrl
inputInlineQueryResultVoiceNote.VoiceNoteDuration = tmp.VoiceNoteDuration
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
inputInlineQueryResultVoiceNote.ReplyMarkup = fieldReplyMarkup
fieldInputMessageContent, _ := UnmarshalInputMessageContent(tmp.InputMessageContent)
inputInlineQueryResultVoiceNote.InputMessageContent = fieldInputMessageContent
return nil
}
// Represents a link to an article or web page
type InlineQueryResultArticle struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// URL of the result, if it exists
Url string `json:"url"`
// True, if the URL must be not shown
HideUrl bool `json:"hide_url"`
// Title of the result
Title string `json:"title"`
// A short description of the result
Description string `json:"description"`
// Result thumbnail in JPEG format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
}
func (entity *InlineQueryResultArticle) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultArticle
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultArticle) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultArticle) GetType() string {
return TypeInlineQueryResultArticle
}
func (*InlineQueryResultArticle) InlineQueryResultType() string {
return TypeInlineQueryResultArticle
}
// Represents a user contact
type InlineQueryResultContact struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// A user contact
Contact *Contact `json:"contact"`
// Result thumbnail in JPEG format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
}
func (entity *InlineQueryResultContact) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultContact
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultContact) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultContact) GetType() string {
return TypeInlineQueryResultContact
}
func (*InlineQueryResultContact) InlineQueryResultType() string {
return TypeInlineQueryResultContact
}
// Represents a point on the map
type InlineQueryResultLocation struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Location result
Location *Location `json:"location"`
// Title of the result
Title string `json:"title"`
// Result thumbnail in JPEG format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
}
func (entity *InlineQueryResultLocation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultLocation
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultLocation) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultLocation) GetType() string {
return TypeInlineQueryResultLocation
}
func (*InlineQueryResultLocation) InlineQueryResultType() string {
return TypeInlineQueryResultLocation
}
// Represents information about a venue
type InlineQueryResultVenue struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Venue result
Venue *Venue `json:"venue"`
// Result thumbnail in JPEG format; may be null
Thumbnail *Thumbnail `json:"thumbnail"`
}
func (entity *InlineQueryResultVenue) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultVenue
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultVenue) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultVenue) GetType() string {
return TypeInlineQueryResultVenue
}
func (*InlineQueryResultVenue) InlineQueryResultType() string {
return TypeInlineQueryResultVenue
}
// Represents information about a game
type InlineQueryResultGame struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Game result
Game *Game `json:"game"`
}
func (entity *InlineQueryResultGame) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultGame
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultGame) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultGame) GetType() string {
return TypeInlineQueryResultGame
}
func (*InlineQueryResultGame) InlineQueryResultType() string {
return TypeInlineQueryResultGame
}
// Represents an animation file
type InlineQueryResultAnimation struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Animation file
Animation *Animation `json:"animation"`
// Animation title
Title string `json:"title"`
}
func (entity *InlineQueryResultAnimation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultAnimation
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultAnimation) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultAnimation) GetType() string {
return TypeInlineQueryResultAnimation
}
func (*InlineQueryResultAnimation) InlineQueryResultType() string {
return TypeInlineQueryResultAnimation
}
// Represents an audio file
type InlineQueryResultAudio struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Audio file
Audio *Audio `json:"audio"`
}
func (entity *InlineQueryResultAudio) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultAudio
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultAudio) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultAudio) GetType() string {
return TypeInlineQueryResultAudio
}
func (*InlineQueryResultAudio) InlineQueryResultType() string {
return TypeInlineQueryResultAudio
}
// Represents a document
type InlineQueryResultDocument struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Document
Document *Document `json:"document"`
// Document title
Title string `json:"title"`
// Document description
Description string `json:"description"`
}
func (entity *InlineQueryResultDocument) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultDocument
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultDocument) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultDocument) GetType() string {
return TypeInlineQueryResultDocument
}
func (*InlineQueryResultDocument) InlineQueryResultType() string {
return TypeInlineQueryResultDocument
}
// Represents a photo
type InlineQueryResultPhoto struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Photo
Photo *Photo `json:"photo"`
// Title of the result, if known
Title string `json:"title"`
// A short description of the result, if known
Description string `json:"description"`
}
func (entity *InlineQueryResultPhoto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultPhoto
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultPhoto) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultPhoto) GetType() string {
return TypeInlineQueryResultPhoto
}
func (*InlineQueryResultPhoto) InlineQueryResultType() string {
return TypeInlineQueryResultPhoto
}
// Represents a sticker
type InlineQueryResultSticker struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Sticker
Sticker *Sticker `json:"sticker"`
}
func (entity *InlineQueryResultSticker) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultSticker
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultSticker) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultSticker) GetType() string {
return TypeInlineQueryResultSticker
}
func (*InlineQueryResultSticker) InlineQueryResultType() string {
return TypeInlineQueryResultSticker
}
// Represents a video
type InlineQueryResultVideo struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Video
Video *Video `json:"video"`
// Title of the video
Title string `json:"title"`
// Description of the video
Description string `json:"description"`
}
func (entity *InlineQueryResultVideo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultVideo
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultVideo) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultVideo) GetType() string {
return TypeInlineQueryResultVideo
}
func (*InlineQueryResultVideo) InlineQueryResultType() string {
return TypeInlineQueryResultVideo
}
// Represents a voice note
type InlineQueryResultVoiceNote struct {
meta
// Unique identifier of the query result
Id string `json:"id"`
// Voice note
VoiceNote *VoiceNote `json:"voice_note"`
// Title of the voice note
Title string `json:"title"`
}
func (entity *InlineQueryResultVoiceNote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResultVoiceNote
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResultVoiceNote) GetClass() string {
return ClassInlineQueryResult
}
func (*InlineQueryResultVoiceNote) GetType() string {
return TypeInlineQueryResultVoiceNote
}
func (*InlineQueryResultVoiceNote) InlineQueryResultType() string {
return TypeInlineQueryResultVoiceNote
}
// Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query
type InlineQueryResults struct {
meta
// Unique identifier of the inline query
InlineQueryId JsonInt64 `json:"inline_query_id"`
// The offset for the next request. If empty, there are no more results
NextOffset string `json:"next_offset"`
// Results of the query
Results []InlineQueryResult `json:"results"`
// If non-empty, this text must be shown on the button, which opens a private chat with the bot and sends the bot a start message with the switch_pm_parameter
SwitchPmText string `json:"switch_pm_text"`
// Parameter for the bot start message
SwitchPmParameter string `json:"switch_pm_parameter"`
}
func (entity *InlineQueryResults) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InlineQueryResults
return json.Marshal((*stub)(entity))
}
func (*InlineQueryResults) GetClass() string {
return ClassInlineQueryResults
}
func (*InlineQueryResults) GetType() string {
return TypeInlineQueryResults
}
func (inlineQueryResults *InlineQueryResults) UnmarshalJSON(data []byte) error {
var tmp struct {
InlineQueryId JsonInt64 `json:"inline_query_id"`
NextOffset string `json:"next_offset"`
Results []json.RawMessage `json:"results"`
SwitchPmText string `json:"switch_pm_text"`
SwitchPmParameter string `json:"switch_pm_parameter"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
inlineQueryResults.InlineQueryId = tmp.InlineQueryId
inlineQueryResults.NextOffset = tmp.NextOffset
inlineQueryResults.SwitchPmText = tmp.SwitchPmText
inlineQueryResults.SwitchPmParameter = tmp.SwitchPmParameter
fieldResults, _ := UnmarshalListOfInlineQueryResult(tmp.Results)
inlineQueryResults.Results = fieldResults
return nil
}
// The payload for a general callback button
type CallbackQueryPayloadData struct {
meta
// Data that was attached to the callback button
Data []byte `json:"data"`
}
func (entity *CallbackQueryPayloadData) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallbackQueryPayloadData
return json.Marshal((*stub)(entity))
}
func (*CallbackQueryPayloadData) GetClass() string {
return ClassCallbackQueryPayload
}
func (*CallbackQueryPayloadData) GetType() string {
return TypeCallbackQueryPayloadData
}
func (*CallbackQueryPayloadData) CallbackQueryPayloadType() string {
return TypeCallbackQueryPayloadData
}
// The payload for a callback button requiring password
type CallbackQueryPayloadDataWithPassword struct {
meta
2023-06-04 22:58:07 +02:00
// The 2-step verification password for the current user
2021-12-08 10:23:00 +01:00
Password string `json:"password"`
// Data that was attached to the callback button
Data []byte `json:"data"`
}
func (entity *CallbackQueryPayloadDataWithPassword) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallbackQueryPayloadDataWithPassword
return json.Marshal((*stub)(entity))
}
func (*CallbackQueryPayloadDataWithPassword) GetClass() string {
return ClassCallbackQueryPayload
}
func (*CallbackQueryPayloadDataWithPassword) GetType() string {
return TypeCallbackQueryPayloadDataWithPassword
}
func (*CallbackQueryPayloadDataWithPassword) CallbackQueryPayloadType() string {
return TypeCallbackQueryPayloadDataWithPassword
}
// The payload for a game callback button
type CallbackQueryPayloadGame struct {
meta
// A short name of the game that was attached to the callback button
GameShortName string `json:"game_short_name"`
}
func (entity *CallbackQueryPayloadGame) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallbackQueryPayloadGame
return json.Marshal((*stub)(entity))
}
func (*CallbackQueryPayloadGame) GetClass() string {
return ClassCallbackQueryPayload
}
func (*CallbackQueryPayloadGame) GetType() string {
return TypeCallbackQueryPayloadGame
}
func (*CallbackQueryPayloadGame) CallbackQueryPayloadType() string {
return TypeCallbackQueryPayloadGame
}
// Contains a bot's answer to a callback query
type CallbackQueryAnswer struct {
meta
// Text of the answer
Text string `json:"text"`
// True, if an alert must be shown to the user instead of a toast notification
ShowAlert bool `json:"show_alert"`
// URL to be opened
Url string `json:"url"`
}
func (entity *CallbackQueryAnswer) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CallbackQueryAnswer
return json.Marshal((*stub)(entity))
}
func (*CallbackQueryAnswer) GetClass() string {
return ClassCallbackQueryAnswer
}
func (*CallbackQueryAnswer) GetType() string {
return TypeCallbackQueryAnswer
}
// Contains the result of a custom request
type CustomRequestResult struct {
meta
// A JSON-serialized result
Result string `json:"result"`
}
func (entity *CustomRequestResult) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CustomRequestResult
return json.Marshal((*stub)(entity))
}
func (*CustomRequestResult) GetClass() string {
return ClassCustomRequestResult
}
func (*CustomRequestResult) GetType() string {
return TypeCustomRequestResult
}
// Contains one row of the game high score table
type GameHighScore struct {
meta
// Position in the high score table
Position int32 `json:"position"`
// User identifier
UserId int64 `json:"user_id"`
// User score
Score int32 `json:"score"`
}
func (entity *GameHighScore) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GameHighScore
return json.Marshal((*stub)(entity))
}
func (*GameHighScore) GetClass() string {
return ClassGameHighScore
}
func (*GameHighScore) GetType() string {
return TypeGameHighScore
}
// Contains a list of game high scores
type GameHighScores struct {
meta
// A list of game high scores
Scores []*GameHighScore `json:"scores"`
}
func (entity *GameHighScores) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub GameHighScores
return json.Marshal((*stub)(entity))
}
func (*GameHighScores) GetClass() string {
return ClassGameHighScores
}
func (*GameHighScores) GetType() string {
return TypeGameHighScores
}
// A message was edited
type ChatEventMessageEdited struct {
meta
// The original message before the edit
OldMessage *Message `json:"old_message"`
// The message after it was edited
NewMessage *Message `json:"new_message"`
}
func (entity *ChatEventMessageEdited) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventMessageEdited
return json.Marshal((*stub)(entity))
}
func (*ChatEventMessageEdited) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventMessageEdited) GetType() string {
return TypeChatEventMessageEdited
}
func (*ChatEventMessageEdited) ChatEventActionType() string {
return TypeChatEventMessageEdited
}
// A message was deleted
type ChatEventMessageDeleted struct {
meta
// Deleted message
Message *Message `json:"message"`
2023-06-04 22:58:07 +02:00
// True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive
CanReportAntiSpamFalsePositive bool `json:"can_report_anti_spam_false_positive"`
2021-12-08 10:23:00 +01:00
}
func (entity *ChatEventMessageDeleted) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventMessageDeleted
return json.Marshal((*stub)(entity))
}
func (*ChatEventMessageDeleted) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventMessageDeleted) GetType() string {
return TypeChatEventMessageDeleted
}
func (*ChatEventMessageDeleted) ChatEventActionType() string {
return TypeChatEventMessageDeleted
}
// A message was pinned
type ChatEventMessagePinned struct {
meta
// Pinned message
Message *Message `json:"message"`
}
func (entity *ChatEventMessagePinned) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventMessagePinned
return json.Marshal((*stub)(entity))
}
func (*ChatEventMessagePinned) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventMessagePinned) GetType() string {
return TypeChatEventMessagePinned
}
func (*ChatEventMessagePinned) ChatEventActionType() string {
return TypeChatEventMessagePinned
}
// A message was unpinned
type ChatEventMessageUnpinned struct {
meta
// Unpinned message
Message *Message `json:"message"`
}
func (entity *ChatEventMessageUnpinned) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventMessageUnpinned
return json.Marshal((*stub)(entity))
}
func (*ChatEventMessageUnpinned) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventMessageUnpinned) GetType() string {
return TypeChatEventMessageUnpinned
}
func (*ChatEventMessageUnpinned) ChatEventActionType() string {
return TypeChatEventMessageUnpinned
}
2023-06-04 22:58:07 +02:00
// A poll in a message was stopped
type ChatEventPollStopped struct {
2021-12-08 10:23:00 +01:00
meta
2023-06-04 22:58:07 +02:00
// The message with the poll
Message *Message `json:"message"`
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (entity *ChatEventPollStopped) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ChatEventPollStopped
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ChatEventPollStopped) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventPollStopped) GetType() string {
return TypeChatEventPollStopped
}
func (*ChatEventPollStopped) ChatEventActionType() string {
return TypeChatEventPollStopped
}
// A new member joined the chat
type ChatEventMemberJoined struct {
meta
}
func (entity *ChatEventMemberJoined) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventMemberJoined
return json.Marshal((*stub)(entity))
}
func (*ChatEventMemberJoined) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
}
func (*ChatEventMemberJoined) GetType() string {
return TypeChatEventMemberJoined
}
func (*ChatEventMemberJoined) ChatEventActionType() string {
return TypeChatEventMemberJoined
}
2022-04-18 22:45:01 +02:00
// A new member joined the chat via an invite link
2021-12-08 10:23:00 +01:00
type ChatEventMemberJoinedByInviteLink struct {
meta
// Invite link used to join the chat
InviteLink *ChatInviteLink `json:"invite_link"`
}
func (entity *ChatEventMemberJoinedByInviteLink) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventMemberJoinedByInviteLink
return json.Marshal((*stub)(entity))
}
func (*ChatEventMemberJoinedByInviteLink) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventMemberJoinedByInviteLink) GetType() string {
return TypeChatEventMemberJoinedByInviteLink
}
func (*ChatEventMemberJoinedByInviteLink) ChatEventActionType() string {
return TypeChatEventMemberJoinedByInviteLink
}
// A new member was accepted to the chat by an administrator
type ChatEventMemberJoinedByRequest struct {
meta
// User identifier of the chat administrator, approved user join request
ApproverUserId int64 `json:"approver_user_id"`
// Invite link used to join the chat; may be null
InviteLink *ChatInviteLink `json:"invite_link"`
}
func (entity *ChatEventMemberJoinedByRequest) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventMemberJoinedByRequest
return json.Marshal((*stub)(entity))
}
func (*ChatEventMemberJoinedByRequest) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventMemberJoinedByRequest) GetType() string {
return TypeChatEventMemberJoinedByRequest
}
func (*ChatEventMemberJoinedByRequest) ChatEventActionType() string {
return TypeChatEventMemberJoinedByRequest
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A new chat member was invited
type ChatEventMemberInvited struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// New member user identifier
UserId int64 `json:"user_id"`
// New member status
Status ChatMemberStatus `json:"status"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatEventMemberInvited) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatEventMemberInvited
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatEventMemberInvited) GetClass() string {
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventMemberInvited) GetType() string {
return TypeChatEventMemberInvited
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventMemberInvited) ChatEventActionType() string {
return TypeChatEventMemberInvited
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (chatEventMemberInvited *ChatEventMemberInvited) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
Status json.RawMessage `json:"status"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
chatEventMemberInvited.UserId = tmp.UserId
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status)
chatEventMemberInvited.Status = fieldStatus
2021-10-22 16:24:12 +02:00
return nil
}
2023-06-04 22:58:07 +02:00
// A member left the chat
type ChatEventMemberLeft struct {
meta
}
func (entity *ChatEventMemberLeft) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventMemberLeft
return json.Marshal((*stub)(entity))
}
func (*ChatEventMemberLeft) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventMemberLeft) GetType() string {
return TypeChatEventMemberLeft
}
func (*ChatEventMemberLeft) ChatEventActionType() string {
return TypeChatEventMemberLeft
}
2022-04-18 22:45:01 +02:00
// A chat member has gained/lost administrator status, or the list of their administrator privileges has changed
2021-12-08 10:23:00 +01:00
type ChatEventMemberPromoted struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Affected chat member user identifier
UserId int64 `json:"user_id"`
// Previous status of the chat member
OldStatus ChatMemberStatus `json:"old_status"`
// New status of the chat member
NewStatus ChatMemberStatus `json:"new_status"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatEventMemberPromoted) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatEventMemberPromoted
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatEventMemberPromoted) GetClass() string {
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventMemberPromoted) GetType() string {
return TypeChatEventMemberPromoted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventMemberPromoted) ChatEventActionType() string {
return TypeChatEventMemberPromoted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (chatEventMemberPromoted *ChatEventMemberPromoted) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
OldStatus json.RawMessage `json:"old_status"`
NewStatus json.RawMessage `json:"new_status"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
chatEventMemberPromoted.UserId = tmp.UserId
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldOldStatus, _ := UnmarshalChatMemberStatus(tmp.OldStatus)
chatEventMemberPromoted.OldStatus = fieldOldStatus
fieldNewStatus, _ := UnmarshalChatMemberStatus(tmp.NewStatus)
chatEventMemberPromoted.NewStatus = fieldNewStatus
2021-10-22 16:24:12 +02:00
return nil
}
2021-12-08 10:23:00 +01:00
// A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed
type ChatEventMemberRestricted struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Affected chat member identifier
MemberId MessageSender `json:"member_id"`
// Previous status of the chat member
OldStatus ChatMemberStatus `json:"old_status"`
// New status of the chat member
NewStatus ChatMemberStatus `json:"new_status"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatEventMemberRestricted) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatEventMemberRestricted
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatEventMemberRestricted) GetClass() string {
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventMemberRestricted) GetType() string {
return TypeChatEventMemberRestricted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventMemberRestricted) ChatEventActionType() string {
return TypeChatEventMemberRestricted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (chatEventMemberRestricted *ChatEventMemberRestricted) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2021-12-08 10:23:00 +01:00
MemberId json.RawMessage `json:"member_id"`
OldStatus json.RawMessage `json:"old_status"`
NewStatus json.RawMessage `json:"new_status"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId)
chatEventMemberRestricted.MemberId = fieldMemberId
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldOldStatus, _ := UnmarshalChatMemberStatus(tmp.OldStatus)
chatEventMemberRestricted.OldStatus = fieldOldStatus
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldNewStatus, _ := UnmarshalChatMemberStatus(tmp.NewStatus)
chatEventMemberRestricted.NewStatus = fieldNewStatus
2021-10-22 16:24:12 +02:00
return nil
}
2023-06-04 22:58:07 +02:00
// The chat available reactions were changed
type ChatEventAvailableReactionsChanged struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Previous chat available reactions
OldAvailableReactions ChatAvailableReactions `json:"old_available_reactions"`
// New chat available reactions
NewAvailableReactions ChatAvailableReactions `json:"new_available_reactions"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *ChatEventAvailableReactionsChanged) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ChatEventAvailableReactionsChanged
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ChatEventAvailableReactionsChanged) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
}
2023-06-04 22:58:07 +02:00
func (*ChatEventAvailableReactionsChanged) GetType() string {
return TypeChatEventAvailableReactionsChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventAvailableReactionsChanged) ChatEventActionType() string {
return TypeChatEventAvailableReactionsChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (chatEventAvailableReactionsChanged *ChatEventAvailableReactionsChanged) UnmarshalJSON(data []byte) error {
var tmp struct {
OldAvailableReactions json.RawMessage `json:"old_available_reactions"`
NewAvailableReactions json.RawMessage `json:"new_available_reactions"`
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
fieldOldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.OldAvailableReactions)
chatEventAvailableReactionsChanged.OldAvailableReactions = fieldOldAvailableReactions
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
fieldNewAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.NewAvailableReactions)
chatEventAvailableReactionsChanged.NewAvailableReactions = fieldNewAvailableReactions
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:53:18 +02:00
// The chat description was changed
type ChatEventDescriptionChanged struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:53:18 +02:00
// Previous chat description
OldDescription string `json:"old_description"`
// New chat description
NewDescription string `json:"new_description"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:53:18 +02:00
func (entity *ChatEventDescriptionChanged) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:53:18 +02:00
type stub ChatEventDescriptionChanged
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:53:18 +02:00
func (*ChatEventDescriptionChanged) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:53:18 +02:00
func (*ChatEventDescriptionChanged) GetType() string {
return TypeChatEventDescriptionChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:53:18 +02:00
func (*ChatEventDescriptionChanged) ChatEventActionType() string {
return TypeChatEventDescriptionChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The linked chat of a supergroup was changed
type ChatEventLinkedChatChanged struct {
2021-12-08 10:23:00 +01:00
meta
2023-06-04 22:58:07 +02:00
// Previous supergroup linked chat identifier
OldLinkedChatId int64 `json:"old_linked_chat_id"`
// New supergroup linked chat identifier
NewLinkedChatId int64 `json:"new_linked_chat_id"`
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (entity *ChatEventLinkedChatChanged) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
type stub ChatEventLinkedChatChanged
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*ChatEventLinkedChatChanged) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*ChatEventLinkedChatChanged) GetType() string {
return TypeChatEventLinkedChatChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventLinkedChatChanged) ChatEventActionType() string {
return TypeChatEventLinkedChatChanged
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// The supergroup location was changed
type ChatEventLocationChanged struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Previous location; may be null
OldLocation *ChatLocation `json:"old_location"`
// New location; may be null
NewLocation *ChatLocation `json:"new_location"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *ChatEventLocationChanged) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ChatEventLocationChanged
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ChatEventLocationChanged) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventLocationChanged) GetType() string {
return TypeChatEventLocationChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventLocationChanged) ChatEventActionType() string {
return TypeChatEventLocationChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The message auto-delete timer was changed
type ChatEventMessageAutoDeleteTimeChanged struct {
2021-12-08 10:23:00 +01:00
meta
2023-06-04 22:58:07 +02:00
// Previous value of message_auto_delete_time
OldMessageAutoDeleteTime int32 `json:"old_message_auto_delete_time"`
// New value of message_auto_delete_time
NewMessageAutoDeleteTime int32 `json:"new_message_auto_delete_time"`
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (entity *ChatEventMessageAutoDeleteTimeChanged) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
type stub ChatEventMessageAutoDeleteTimeChanged
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*ChatEventMessageAutoDeleteTimeChanged) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*ChatEventMessageAutoDeleteTimeChanged) GetType() string {
return TypeChatEventMessageAutoDeleteTimeChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventMessageAutoDeleteTimeChanged) ChatEventActionType() string {
return TypeChatEventMessageAutoDeleteTimeChanged
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// The chat permissions was changed
type ChatEventPermissionsChanged struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Previous chat permissions
OldPermissions *ChatPermissions `json:"old_permissions"`
// New chat permissions
NewPermissions *ChatPermissions `json:"new_permissions"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *ChatEventPermissionsChanged) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ChatEventPermissionsChanged
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ChatEventPermissionsChanged) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
}
2023-06-04 22:58:07 +02:00
func (*ChatEventPermissionsChanged) GetType() string {
return TypeChatEventPermissionsChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventPermissionsChanged) ChatEventActionType() string {
return TypeChatEventPermissionsChanged
}
// The chat photo was changed
type ChatEventPhotoChanged struct {
meta
// Previous chat photo value; may be null
OldPhoto *ChatPhoto `json:"old_photo"`
// New chat photo value; may be null
NewPhoto *ChatPhoto `json:"new_photo"`
}
func (entity *ChatEventPhotoChanged) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventPhotoChanged
return json.Marshal((*stub)(entity))
}
func (*ChatEventPhotoChanged) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventPhotoChanged) GetType() string {
return TypeChatEventPhotoChanged
}
func (*ChatEventPhotoChanged) ChatEventActionType() string {
return TypeChatEventPhotoChanged
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The slow_mode_delay setting of a supergroup was changed
type ChatEventSlowModeDelayChanged struct {
meta
// Previous value of slow_mode_delay, in seconds
OldSlowModeDelay int32 `json:"old_slow_mode_delay"`
// New value of slow_mode_delay, in seconds
NewSlowModeDelay int32 `json:"new_slow_mode_delay"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatEventSlowModeDelayChanged) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
type stub ChatEventSlowModeDelayChanged
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*ChatEventSlowModeDelayChanged) GetClass() string {
return ClassChatEventAction
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*ChatEventSlowModeDelayChanged) GetType() string {
return TypeChatEventSlowModeDelayChanged
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*ChatEventSlowModeDelayChanged) ChatEventActionType() string {
return TypeChatEventSlowModeDelayChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The supergroup sticker set was changed
type ChatEventStickerSetChanged struct {
2022-04-18 22:45:01 +02:00
meta
2023-06-04 22:58:07 +02:00
// Previous identifier of the chat sticker set; 0 if none
OldStickerSetId JsonInt64 `json:"old_sticker_set_id"`
// New identifier of the chat sticker set; 0 if none
NewStickerSetId JsonInt64 `json:"new_sticker_set_id"`
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *ChatEventStickerSetChanged) MarshalJSON() ([]byte, error) {
2022-04-18 22:45:01 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ChatEventStickerSetChanged
2022-04-18 22:45:01 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ChatEventStickerSetChanged) GetClass() string {
2022-04-18 22:45:01 +02:00
return ClassChatEventAction
}
2023-06-04 22:58:07 +02:00
func (*ChatEventStickerSetChanged) GetType() string {
return TypeChatEventStickerSetChanged
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventStickerSetChanged) ChatEventActionType() string {
return TypeChatEventStickerSetChanged
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
// The chat title was changed
type ChatEventTitleChanged struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Previous chat title
OldTitle string `json:"old_title"`
// New chat title
NewTitle string `json:"new_title"`
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (entity *ChatEventTitleChanged) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ChatEventTitleChanged
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ChatEventTitleChanged) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventTitleChanged) GetType() string {
return TypeChatEventTitleChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventTitleChanged) ChatEventActionType() string {
return TypeChatEventTitleChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The chat editable username was changed
type ChatEventUsernameChanged struct {
2021-12-08 10:23:00 +01:00
meta
2023-06-04 22:58:07 +02:00
// Previous chat username
OldUsername string `json:"old_username"`
// New chat username
NewUsername string `json:"new_username"`
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (entity *ChatEventUsernameChanged) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
type stub ChatEventUsernameChanged
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*ChatEventUsernameChanged) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*ChatEventUsernameChanged) GetType() string {
return TypeChatEventUsernameChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventUsernameChanged) ChatEventActionType() string {
return TypeChatEventUsernameChanged
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// The chat active usernames were changed
type ChatEventActiveUsernamesChanged struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Previous list of active usernames
OldUsernames []string `json:"old_usernames"`
// New list of active usernames
NewUsernames []string `json:"new_usernames"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *ChatEventActiveUsernamesChanged) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ChatEventActiveUsernamesChanged
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ChatEventActiveUsernamesChanged) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventActiveUsernamesChanged) GetType() string {
return TypeChatEventActiveUsernamesChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventActiveUsernamesChanged) ChatEventActionType() string {
return TypeChatEventActiveUsernamesChanged
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The has_protected_content setting of a channel was toggled
type ChatEventHasProtectedContentToggled struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// New value of has_protected_content
HasProtectedContent bool `json:"has_protected_content"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *ChatEventHasProtectedContentToggled) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ChatEventHasProtectedContentToggled
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ChatEventHasProtectedContentToggled) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventHasProtectedContentToggled) GetType() string {
return TypeChatEventHasProtectedContentToggled
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventHasProtectedContentToggled) ChatEventActionType() string {
return TypeChatEventHasProtectedContentToggled
}
// The can_invite_users permission of a supergroup chat was toggled
type ChatEventInvitesToggled struct {
meta
// New value of can_invite_users permission
CanInviteUsers bool `json:"can_invite_users"`
}
func (entity *ChatEventInvitesToggled) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventInvitesToggled
return json.Marshal((*stub)(entity))
}
func (*ChatEventInvitesToggled) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventInvitesToggled) GetType() string {
return TypeChatEventInvitesToggled
}
func (*ChatEventInvitesToggled) ChatEventActionType() string {
return TypeChatEventInvitesToggled
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// The is_all_history_available setting of a supergroup was toggled
type ChatEventIsAllHistoryAvailableToggled struct {
2021-10-22 16:24:12 +02:00
meta
2022-04-18 22:45:01 +02:00
// New value of is_all_history_available
IsAllHistoryAvailable bool `json:"is_all_history_available"`
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (entity *ChatEventIsAllHistoryAvailableToggled) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub ChatEventIsAllHistoryAvailableToggled
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*ChatEventIsAllHistoryAvailableToggled) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (*ChatEventIsAllHistoryAvailableToggled) GetType() string {
return TypeChatEventIsAllHistoryAvailableToggled
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (*ChatEventIsAllHistoryAvailableToggled) ChatEventActionType() string {
return TypeChatEventIsAllHistoryAvailableToggled
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The has_aggressive_anti_spam_enabled setting of a supergroup was toggled
type ChatEventHasAggressiveAntiSpamEnabledToggled struct {
meta
// New value of has_aggressive_anti_spam_enabled
HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"`
}
func (entity *ChatEventHasAggressiveAntiSpamEnabledToggled) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventHasAggressiveAntiSpamEnabledToggled
return json.Marshal((*stub)(entity))
}
func (*ChatEventHasAggressiveAntiSpamEnabledToggled) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventHasAggressiveAntiSpamEnabledToggled) GetType() string {
return TypeChatEventHasAggressiveAntiSpamEnabledToggled
}
func (*ChatEventHasAggressiveAntiSpamEnabledToggled) ChatEventActionType() string {
return TypeChatEventHasAggressiveAntiSpamEnabledToggled
}
// The sign_messages setting of a channel was toggled
type ChatEventSignMessagesToggled struct {
meta
// New value of sign_messages
SignMessages bool `json:"sign_messages"`
}
func (entity *ChatEventSignMessagesToggled) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventSignMessagesToggled
return json.Marshal((*stub)(entity))
}
func (*ChatEventSignMessagesToggled) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventSignMessagesToggled) GetType() string {
return TypeChatEventSignMessagesToggled
}
func (*ChatEventSignMessagesToggled) ChatEventActionType() string {
return TypeChatEventSignMessagesToggled
}
2021-12-08 10:23:00 +01:00
// A chat invite link was edited
type ChatEventInviteLinkEdited struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Previous information about the invite link
OldInviteLink *ChatInviteLink `json:"old_invite_link"`
// New information about the invite link
NewInviteLink *ChatInviteLink `json:"new_invite_link"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatEventInviteLinkEdited) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatEventInviteLinkEdited
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatEventInviteLinkEdited) GetClass() string {
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventInviteLinkEdited) GetType() string {
return TypeChatEventInviteLinkEdited
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventInviteLinkEdited) ChatEventActionType() string {
return TypeChatEventInviteLinkEdited
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A chat invite link was revoked
type ChatEventInviteLinkRevoked struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The invite link
InviteLink *ChatInviteLink `json:"invite_link"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatEventInviteLinkRevoked) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatEventInviteLinkRevoked
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatEventInviteLinkRevoked) GetClass() string {
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventInviteLinkRevoked) GetType() string {
return TypeChatEventInviteLinkRevoked
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventInviteLinkRevoked) ChatEventActionType() string {
return TypeChatEventInviteLinkRevoked
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A revoked chat invite link was deleted
type ChatEventInviteLinkDeleted struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The invite link
InviteLink *ChatInviteLink `json:"invite_link"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatEventInviteLinkDeleted) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatEventInviteLinkDeleted
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatEventInviteLinkDeleted) GetClass() string {
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventInviteLinkDeleted) GetType() string {
return TypeChatEventInviteLinkDeleted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventInviteLinkDeleted) ChatEventActionType() string {
return TypeChatEventInviteLinkDeleted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A video chat was created
type ChatEventVideoChatCreated struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the video chat. The video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatEventVideoChatCreated) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatEventVideoChatCreated
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatEventVideoChatCreated) GetClass() string {
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventVideoChatCreated) GetType() string {
return TypeChatEventVideoChatCreated
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventVideoChatCreated) ChatEventActionType() string {
return TypeChatEventVideoChatCreated
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// A video chat was ended
type ChatEventVideoChatEnded struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the video chat. The video chat can be received through the method getGroupCall
GroupCallId int32 `json:"group_call_id"`
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (entity *ChatEventVideoChatEnded) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventVideoChatEnded
return json.Marshal((*stub)(entity))
}
func (*ChatEventVideoChatEnded) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventVideoChatEnded) GetType() string {
return TypeChatEventVideoChatEnded
}
func (*ChatEventVideoChatEnded) ChatEventActionType() string {
return TypeChatEventVideoChatEnded
}
2023-06-04 22:58:07 +02:00
// The mute_new_participants setting of a video chat was toggled
type ChatEventVideoChatMuteNewParticipantsToggled struct {
meta
// New value of the mute_new_participants setting
MuteNewParticipants bool `json:"mute_new_participants"`
}
func (entity *ChatEventVideoChatMuteNewParticipantsToggled) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventVideoChatMuteNewParticipantsToggled
return json.Marshal((*stub)(entity))
}
func (*ChatEventVideoChatMuteNewParticipantsToggled) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventVideoChatMuteNewParticipantsToggled) GetType() string {
return TypeChatEventVideoChatMuteNewParticipantsToggled
}
func (*ChatEventVideoChatMuteNewParticipantsToggled) ChatEventActionType() string {
return TypeChatEventVideoChatMuteNewParticipantsToggled
}
2021-12-08 10:23:00 +01:00
// A video chat participant was muted or unmuted
type ChatEventVideoChatParticipantIsMutedToggled struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the affected group call participant
ParticipantId MessageSender `json:"participant_id"`
// New value of is_muted
IsMuted bool `json:"is_muted"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatEventVideoChatParticipantIsMutedToggled) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatEventVideoChatParticipantIsMutedToggled
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatEventVideoChatParticipantIsMutedToggled) GetClass() string {
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventVideoChatParticipantIsMutedToggled) GetType() string {
return TypeChatEventVideoChatParticipantIsMutedToggled
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventVideoChatParticipantIsMutedToggled) ChatEventActionType() string {
return TypeChatEventVideoChatParticipantIsMutedToggled
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (chatEventVideoChatParticipantIsMutedToggled *ChatEventVideoChatParticipantIsMutedToggled) UnmarshalJSON(data []byte) error {
var tmp struct {
ParticipantId json.RawMessage `json:"participant_id"`
IsMuted bool `json:"is_muted"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chatEventVideoChatParticipantIsMutedToggled.IsMuted = tmp.IsMuted
fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId)
chatEventVideoChatParticipantIsMutedToggled.ParticipantId = fieldParticipantId
return nil
}
// A video chat participant volume level was changed
type ChatEventVideoChatParticipantVolumeLevelChanged struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Identifier of the affected group call participant
ParticipantId MessageSender `json:"participant_id"`
// New value of volume_level; 1-20000 in hundreds of percents
VolumeLevel int32 `json:"volume_level"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ChatEventVideoChatParticipantVolumeLevelChanged) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatEventVideoChatParticipantVolumeLevelChanged
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatEventVideoChatParticipantVolumeLevelChanged) GetClass() string {
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventVideoChatParticipantVolumeLevelChanged) GetType() string {
return TypeChatEventVideoChatParticipantVolumeLevelChanged
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatEventVideoChatParticipantVolumeLevelChanged) ChatEventActionType() string {
return TypeChatEventVideoChatParticipantVolumeLevelChanged
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (chatEventVideoChatParticipantVolumeLevelChanged *ChatEventVideoChatParticipantVolumeLevelChanged) UnmarshalJSON(data []byte) error {
var tmp struct {
ParticipantId json.RawMessage `json:"participant_id"`
VolumeLevel int32 `json:"volume_level"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chatEventVideoChatParticipantVolumeLevelChanged.VolumeLevel = tmp.VolumeLevel
fieldParticipantId, _ := UnmarshalMessageSender(tmp.ParticipantId)
chatEventVideoChatParticipantVolumeLevelChanged.ParticipantId = fieldParticipantId
return nil
}
2023-06-04 22:58:07 +02:00
// The is_forum setting of a channel was toggled
type ChatEventIsForumToggled struct {
2023-06-04 22:53:18 +02:00
meta
2023-06-04 22:58:07 +02:00
// New value of is_forum
IsForum bool `json:"is_forum"`
2023-06-04 22:53:18 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *ChatEventIsForumToggled) MarshalJSON() ([]byte, error) {
2023-06-04 22:53:18 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ChatEventIsForumToggled
2023-06-04 22:53:18 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ChatEventIsForumToggled) GetClass() string {
2023-06-04 22:53:18 +02:00
return ClassChatEventAction
}
2023-06-04 22:58:07 +02:00
func (*ChatEventIsForumToggled) GetType() string {
return TypeChatEventIsForumToggled
2023-06-04 22:53:18 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventIsForumToggled) ChatEventActionType() string {
return TypeChatEventIsForumToggled
2023-06-04 22:53:18 +02:00
}
2023-06-04 22:58:07 +02:00
// A new forum topic was created
type ChatEventForumTopicCreated struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Information about the topic
TopicInfo *ForumTopicInfo `json:"topic_info"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *ChatEventForumTopicCreated) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ChatEventForumTopicCreated
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ChatEventForumTopicCreated) GetClass() string {
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventForumTopicCreated) GetType() string {
return TypeChatEventForumTopicCreated
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventForumTopicCreated) ChatEventActionType() string {
return TypeChatEventForumTopicCreated
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
// A forum topic was edited
type ChatEventForumTopicEdited struct {
meta
// Old information about the topic
OldTopicInfo *ForumTopicInfo `json:"old_topic_info"`
// New information about the topic
NewTopicInfo *ForumTopicInfo `json:"new_topic_info"`
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (entity *ChatEventForumTopicEdited) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
2023-06-04 22:58:07 +02:00
type stub ChatEventForumTopicEdited
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*ChatEventForumTopicEdited) GetClass() string {
return ClassChatEventAction
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventForumTopicEdited) GetType() string {
return TypeChatEventForumTopicEdited
}
func (*ChatEventForumTopicEdited) ChatEventActionType() string {
return TypeChatEventForumTopicEdited
}
// A forum topic was closed or reopened
type ChatEventForumTopicToggleIsClosed struct {
2021-12-08 10:23:00 +01:00
meta
2023-06-04 22:58:07 +02:00
// New information about the topic
TopicInfo *ForumTopicInfo `json:"topic_info"`
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (entity *ChatEventForumTopicToggleIsClosed) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub ChatEventForumTopicToggleIsClosed
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*ChatEventForumTopicToggleIsClosed) GetClass() string {
return ClassChatEventAction
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventForumTopicToggleIsClosed) GetType() string {
return TypeChatEventForumTopicToggleIsClosed
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*ChatEventForumTopicToggleIsClosed) ChatEventActionType() string {
return TypeChatEventForumTopicToggleIsClosed
}
// The General forum topic was hidden or unhidden
type ChatEventForumTopicToggleIsHidden struct {
2021-12-08 10:23:00 +01:00
meta
2023-06-04 22:58:07 +02:00
// New information about the topic
TopicInfo *ForumTopicInfo `json:"topic_info"`
}
func (entity *ChatEventForumTopicToggleIsHidden) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventForumTopicToggleIsHidden
return json.Marshal((*stub)(entity))
}
func (*ChatEventForumTopicToggleIsHidden) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventForumTopicToggleIsHidden) GetType() string {
return TypeChatEventForumTopicToggleIsHidden
}
func (*ChatEventForumTopicToggleIsHidden) ChatEventActionType() string {
return TypeChatEventForumTopicToggleIsHidden
}
// A forum topic was deleted
type ChatEventForumTopicDeleted struct {
meta
// Information about the topic
TopicInfo *ForumTopicInfo `json:"topic_info"`
}
func (entity *ChatEventForumTopicDeleted) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventForumTopicDeleted
return json.Marshal((*stub)(entity))
}
func (*ChatEventForumTopicDeleted) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventForumTopicDeleted) GetType() string {
return TypeChatEventForumTopicDeleted
}
func (*ChatEventForumTopicDeleted) ChatEventActionType() string {
return TypeChatEventForumTopicDeleted
}
// A pinned forum topic was changed
type ChatEventForumTopicPinned struct {
meta
// Information about the old pinned topic; may be null
OldTopicInfo *ForumTopicInfo `json:"old_topic_info"`
// Information about the new pinned topic; may be null
NewTopicInfo *ForumTopicInfo `json:"new_topic_info"`
}
func (entity *ChatEventForumTopicPinned) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventForumTopicPinned
return json.Marshal((*stub)(entity))
}
func (*ChatEventForumTopicPinned) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventForumTopicPinned) GetType() string {
return TypeChatEventForumTopicPinned
}
func (*ChatEventForumTopicPinned) ChatEventActionType() string {
return TypeChatEventForumTopicPinned
}
// Represents a chat event
type ChatEvent struct {
meta
// Chat event identifier
Id JsonInt64 `json:"id"`
// Point in time (Unix timestamp) when the event happened
Date int32 `json:"date"`
// Identifier of the user or chat who performed the action
MemberId MessageSender `json:"member_id"`
// The action
Action ChatEventAction `json:"action"`
}
func (entity *ChatEvent) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEvent
return json.Marshal((*stub)(entity))
}
func (*ChatEvent) GetClass() string {
return ClassChatEvent
}
func (*ChatEvent) GetType() string {
return TypeChatEvent
}
func (chatEvent *ChatEvent) UnmarshalJSON(data []byte) error {
var tmp struct {
Id JsonInt64 `json:"id"`
Date int32 `json:"date"`
MemberId json.RawMessage `json:"member_id"`
Action json.RawMessage `json:"action"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chatEvent.Id = tmp.Id
chatEvent.Date = tmp.Date
fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId)
chatEvent.MemberId = fieldMemberId
fieldAction, _ := UnmarshalChatEventAction(tmp.Action)
chatEvent.Action = fieldAction
return nil
}
// Contains a list of chat events
type ChatEvents struct {
meta
// List of events
Events []*ChatEvent `json:"events"`
}
func (entity *ChatEvents) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEvents
return json.Marshal((*stub)(entity))
}
func (*ChatEvents) GetClass() string {
return ClassChatEvents
}
func (*ChatEvents) GetType() string {
return TypeChatEvents
}
// Represents a set of filters used to obtain a chat event log
type ChatEventLogFilters struct {
meta
// True, if message edits need to be returned
MessageEdits bool `json:"message_edits"`
// True, if message deletions need to be returned
MessageDeletions bool `json:"message_deletions"`
// True, if pin/unpin events need to be returned
MessagePins bool `json:"message_pins"`
// True, if members joining events need to be returned
MemberJoins bool `json:"member_joins"`
2021-12-08 10:23:00 +01:00
// True, if members leaving events need to be returned
MemberLeaves bool `json:"member_leaves"`
// True, if invited member events need to be returned
MemberInvites bool `json:"member_invites"`
// True, if member promotion/demotion events need to be returned
MemberPromotions bool `json:"member_promotions"`
// True, if member restricted/unrestricted/banned/unbanned events need to be returned
MemberRestrictions bool `json:"member_restrictions"`
// 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
SettingChanges bool `json:"setting_changes"`
// True, if changes to invite links need to be returned
InviteLinkChanges bool `json:"invite_link_changes"`
// True, if video chat actions need to be returned
VideoChatChanges bool `json:"video_chat_changes"`
2023-06-04 22:58:07 +02:00
// True, if forum-related actions need to be returned
ForumChanges bool `json:"forum_changes"`
2021-12-08 10:23:00 +01:00
}
func (entity *ChatEventLogFilters) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventLogFilters
return json.Marshal((*stub)(entity))
}
func (*ChatEventLogFilters) GetClass() string {
return ClassChatEventLogFilters
}
func (*ChatEventLogFilters) GetType() string {
return TypeChatEventLogFilters
}
// An ordinary language pack string
type LanguagePackStringValueOrdinary struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// String value
Value string `json:"value"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *LanguagePackStringValueOrdinary) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub LanguagePackStringValueOrdinary
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackStringValueOrdinary) GetClass() string {
return ClassLanguagePackStringValue
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackStringValueOrdinary) GetType() string {
return TypeLanguagePackStringValueOrdinary
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackStringValueOrdinary) LanguagePackStringValueType() string {
return TypeLanguagePackStringValueOrdinary
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information
2021-12-08 10:23:00 +01:00
type LanguagePackStringValuePluralized struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Value for zero objects
ZeroValue string `json:"zero_value"`
// Value for one object
OneValue string `json:"one_value"`
// Value for two objects
TwoValue string `json:"two_value"`
// Value for few objects
FewValue string `json:"few_value"`
// Value for many objects
ManyValue string `json:"many_value"`
// Default value
OtherValue string `json:"other_value"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *LanguagePackStringValuePluralized) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub LanguagePackStringValuePluralized
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackStringValuePluralized) GetClass() string {
return ClassLanguagePackStringValue
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackStringValuePluralized) GetType() string {
return TypeLanguagePackStringValuePluralized
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackStringValuePluralized) LanguagePackStringValueType() string {
return TypeLanguagePackStringValuePluralized
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// A deleted language pack string, the value must be taken from the built-in English language pack
type LanguagePackStringValueDeleted struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *LanguagePackStringValueDeleted) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub LanguagePackStringValueDeleted
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackStringValueDeleted) GetClass() string {
return ClassLanguagePackStringValue
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackStringValueDeleted) GetType() string {
return TypeLanguagePackStringValueDeleted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackStringValueDeleted) LanguagePackStringValueType() string {
return TypeLanguagePackStringValueDeleted
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Represents one language pack string
type LanguagePackString struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// String key
Key string `json:"key"`
// String value; pass null if the string needs to be taken from the built-in English language pack
Value LanguagePackStringValue `json:"value"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *LanguagePackString) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub LanguagePackString
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackString) GetClass() string {
return ClassLanguagePackString
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackString) GetType() string {
return TypeLanguagePackString
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (languagePackString *LanguagePackString) UnmarshalJSON(data []byte) error {
var tmp struct {
Key string `json:"key"`
Value json.RawMessage `json:"value"`
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
languagePackString.Key = tmp.Key
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
fieldValue, _ := UnmarshalLanguagePackStringValue(tmp.Value)
languagePackString.Value = fieldValue
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return nil
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains a list of language pack strings
type LanguagePackStrings struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// A list of language pack strings
Strings []*LanguagePackString `json:"strings"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *LanguagePackStrings) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub LanguagePackStrings
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackStrings) GetClass() string {
return ClassLanguagePackStrings
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackStrings) GetType() string {
return TypeLanguagePackStrings
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about a language pack
type LanguagePackInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Unique language pack identifier
Id string `json:"id"`
// Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it must be fetched from base language pack. Unsupported in custom language packs
BaseLanguagePackId string `json:"base_language_pack_id"`
// Language name
Name string `json:"name"`
// Name of the language in that language
NativeName string `json:"native_name"`
2023-06-04 22:58:07 +02:00
// A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information
2021-12-08 10:23:00 +01:00
PluralCode string `json:"plural_code"`
// True, if the language pack is official
IsOfficial bool `json:"is_official"`
// True, if the language pack strings are RTL
IsRtl bool `json:"is_rtl"`
// True, if the language pack is a beta language pack
IsBeta bool `json:"is_beta"`
// True, if the language pack is installed by the current user
IsInstalled bool `json:"is_installed"`
// Total number of non-deleted strings from the language pack
TotalStringCount int32 `json:"total_string_count"`
// Total number of translated strings from the language pack
TranslatedStringCount int32 `json:"translated_string_count"`
// Total number of non-deleted strings from the language pack available locally
LocalStringCount int32 `json:"local_string_count"`
// Link to language translation interface; empty for custom local language packs
TranslationUrl string `json:"translation_url"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *LanguagePackInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub LanguagePackInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackInfo) GetClass() string {
return ClassLanguagePackInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LanguagePackInfo) GetType() string {
return TypeLanguagePackInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about the current localization target
type LocalizationTargetInfo struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of available language packs for this application
LanguagePacks []*LanguagePackInfo `json:"language_packs"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *LocalizationTargetInfo) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub LocalizationTargetInfo
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*LocalizationTargetInfo) GetClass() string {
return ClassLocalizationTargetInfo
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*LocalizationTargetInfo) GetType() string {
return TypeLocalizationTargetInfo
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The maximum number of joined supergroups and channels
type PremiumLimitTypeSupergroupCount struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumLimitTypeSupergroupCount) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumLimitTypeSupergroupCount
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeSupergroupCount) GetClass() string {
return ClassPremiumLimitType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeSupergroupCount) GetType() string {
return TypePremiumLimitTypeSupergroupCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeSupergroupCount) PremiumLimitTypeType() string {
return TypePremiumLimitTypeSupergroupCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The maximum number of pinned chats in the main chat list
type PremiumLimitTypePinnedChatCount struct {
2021-12-08 10:23:00 +01:00
meta
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumLimitTypePinnedChatCount) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumLimitTypePinnedChatCount
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypePinnedChatCount) GetClass() string {
return ClassPremiumLimitType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypePinnedChatCount) GetType() string {
return TypePremiumLimitTypePinnedChatCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypePinnedChatCount) PremiumLimitTypeType() string {
return TypePremiumLimitTypePinnedChatCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The maximum number of created public chats
type PremiumLimitTypeCreatedPublicChatCount struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumLimitTypeCreatedPublicChatCount) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumLimitTypeCreatedPublicChatCount
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeCreatedPublicChatCount) GetClass() string {
return ClassPremiumLimitType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeCreatedPublicChatCount) GetType() string {
return TypePremiumLimitTypeCreatedPublicChatCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeCreatedPublicChatCount) PremiumLimitTypeType() string {
return TypePremiumLimitTypeCreatedPublicChatCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The maximum number of saved animations
type PremiumLimitTypeSavedAnimationCount struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumLimitTypeSavedAnimationCount) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumLimitTypeSavedAnimationCount
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeSavedAnimationCount) GetClass() string {
return ClassPremiumLimitType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeSavedAnimationCount) GetType() string {
return TypePremiumLimitTypeSavedAnimationCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeSavedAnimationCount) PremiumLimitTypeType() string {
return TypePremiumLimitTypeSavedAnimationCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The maximum number of favorite stickers
type PremiumLimitTypeFavoriteStickerCount struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumLimitTypeFavoriteStickerCount) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumLimitTypeFavoriteStickerCount
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeFavoriteStickerCount) GetClass() string {
return ClassPremiumLimitType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeFavoriteStickerCount) GetType() string {
return TypePremiumLimitTypeFavoriteStickerCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeFavoriteStickerCount) PremiumLimitTypeType() string {
return TypePremiumLimitTypeFavoriteStickerCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The maximum number of chat filters
type PremiumLimitTypeChatFilterCount struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumLimitTypeChatFilterCount) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumLimitTypeChatFilterCount
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeChatFilterCount) GetClass() string {
return ClassPremiumLimitType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeChatFilterCount) GetType() string {
return TypePremiumLimitTypeChatFilterCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeChatFilterCount) PremiumLimitTypeType() string {
return TypePremiumLimitTypeChatFilterCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The maximum number of pinned and always included, or always excluded chats in a chat filter
type PremiumLimitTypeChatFilterChosenChatCount struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumLimitTypeChatFilterChosenChatCount) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumLimitTypeChatFilterChosenChatCount
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeChatFilterChosenChatCount) GetClass() string {
return ClassPremiumLimitType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeChatFilterChosenChatCount) GetType() string {
return TypePremiumLimitTypeChatFilterChosenChatCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeChatFilterChosenChatCount) PremiumLimitTypeType() string {
return TypePremiumLimitTypeChatFilterChosenChatCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The maximum number of pinned chats in the archive chat list
type PremiumLimitTypePinnedArchivedChatCount struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumLimitTypePinnedArchivedChatCount) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumLimitTypePinnedArchivedChatCount
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypePinnedArchivedChatCount) GetClass() string {
return ClassPremiumLimitType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypePinnedArchivedChatCount) GetType() string {
return TypePremiumLimitTypePinnedArchivedChatCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypePinnedArchivedChatCount) PremiumLimitTypeType() string {
return TypePremiumLimitTypePinnedArchivedChatCount
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The maximum length of sent media caption
type PremiumLimitTypeCaptionLength struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumLimitTypeCaptionLength) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumLimitTypeCaptionLength
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeCaptionLength) GetClass() string {
return ClassPremiumLimitType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeCaptionLength) GetType() string {
return TypePremiumLimitTypeCaptionLength
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeCaptionLength) PremiumLimitTypeType() string {
return TypePremiumLimitTypeCaptionLength
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The maximum length of the user's bio
type PremiumLimitTypeBioLength struct {
2021-12-08 10:23:00 +01:00
meta
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (entity *PremiumLimitTypeBioLength) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumLimitTypeBioLength
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeBioLength) GetClass() string {
return ClassPremiumLimitType
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeBioLength) GetType() string {
return TypePremiumLimitTypeBioLength
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*PremiumLimitTypeBioLength) PremiumLimitTypeType() string {
return TypePremiumLimitTypeBioLength
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Increased limits
type PremiumFeatureIncreasedLimits struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureIncreasedLimits) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureIncreasedLimits
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureIncreasedLimits) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureIncreasedLimits) GetType() string {
return TypePremiumFeatureIncreasedLimits
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureIncreasedLimits) PremiumFeatureType() string {
return TypePremiumFeatureIncreasedLimits
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Increased maximum upload file size
type PremiumFeatureIncreasedUploadFileSize struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureIncreasedUploadFileSize) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureIncreasedUploadFileSize
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureIncreasedUploadFileSize) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureIncreasedUploadFileSize) GetType() string {
return TypePremiumFeatureIncreasedUploadFileSize
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureIncreasedUploadFileSize) PremiumFeatureType() string {
return TypePremiumFeatureIncreasedUploadFileSize
}
// Improved download speed
type PremiumFeatureImprovedDownloadSpeed struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureImprovedDownloadSpeed) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureImprovedDownloadSpeed
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureImprovedDownloadSpeed) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureImprovedDownloadSpeed) GetType() string {
return TypePremiumFeatureImprovedDownloadSpeed
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureImprovedDownloadSpeed) PremiumFeatureType() string {
return TypePremiumFeatureImprovedDownloadSpeed
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The ability to convert voice notes to text
type PremiumFeatureVoiceRecognition struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureVoiceRecognition) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureVoiceRecognition
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureVoiceRecognition) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureVoiceRecognition) GetType() string {
return TypePremiumFeatureVoiceRecognition
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureVoiceRecognition) PremiumFeatureType() string {
return TypePremiumFeatureVoiceRecognition
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Disabled ads
type PremiumFeatureDisabledAds struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureDisabledAds) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureDisabledAds
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureDisabledAds) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureDisabledAds) GetType() string {
return TypePremiumFeatureDisabledAds
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureDisabledAds) PremiumFeatureType() string {
return TypePremiumFeatureDisabledAds
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Allowed to use more reactions
type PremiumFeatureUniqueReactions struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureUniqueReactions) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureUniqueReactions
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureUniqueReactions) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureUniqueReactions) GetType() string {
return TypePremiumFeatureUniqueReactions
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureUniqueReactions) PremiumFeatureType() string {
return TypePremiumFeatureUniqueReactions
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Allowed to use premium stickers with unique effects
type PremiumFeatureUniqueStickers struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureUniqueStickers) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureUniqueStickers
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureUniqueStickers) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureUniqueStickers) GetType() string {
return TypePremiumFeatureUniqueStickers
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureUniqueStickers) PremiumFeatureType() string {
return TypePremiumFeatureUniqueStickers
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Allowed to use custom emoji stickers in message texts and captions
type PremiumFeatureCustomEmoji struct {
meta
}
2021-12-08 10:23:00 +01:00
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureCustomEmoji) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureCustomEmoji
2021-12-08 10:23:00 +01:00
2023-06-04 22:58:07 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureCustomEmoji) GetClass() string {
return ClassPremiumFeature
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureCustomEmoji) GetType() string {
return TypePremiumFeatureCustomEmoji
}
func (*PremiumFeatureCustomEmoji) PremiumFeatureType() string {
return TypePremiumFeatureCustomEmoji
}
// Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user's contacts joined Telegram
type PremiumFeatureAdvancedChatManagement struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureAdvancedChatManagement) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureAdvancedChatManagement
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureAdvancedChatManagement) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureAdvancedChatManagement) GetType() string {
return TypePremiumFeatureAdvancedChatManagement
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureAdvancedChatManagement) PremiumFeatureType() string {
return TypePremiumFeatureAdvancedChatManagement
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// A badge in the user's profile
type PremiumFeatureProfileBadge struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureProfileBadge) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureProfileBadge
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureProfileBadge) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureProfileBadge) GetType() string {
return TypePremiumFeatureProfileBadge
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureProfileBadge) PremiumFeatureType() string {
return TypePremiumFeatureProfileBadge
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A emoji status shown along with the user's name
type PremiumFeatureEmojiStatus struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureEmojiStatus) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureEmojiStatus
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureEmojiStatus) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureEmojiStatus) GetType() string {
return TypePremiumFeatureEmojiStatus
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureEmojiStatus) PremiumFeatureType() string {
return TypePremiumFeatureEmojiStatus
}
// Profile photo animation on message and chat screens
type PremiumFeatureAnimatedProfilePhoto struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureAnimatedProfilePhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureAnimatedProfilePhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureAnimatedProfilePhoto) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureAnimatedProfilePhoto) GetType() string {
return TypePremiumFeatureAnimatedProfilePhoto
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureAnimatedProfilePhoto) PremiumFeatureType() string {
return TypePremiumFeatureAnimatedProfilePhoto
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The ability to set a custom emoji as a forum topic icon
type PremiumFeatureForumTopicIcon struct {
meta
}
2021-12-08 10:23:00 +01:00
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureForumTopicIcon) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureForumTopicIcon
2021-12-08 10:23:00 +01:00
2023-06-04 22:58:07 +02:00
return json.Marshal((*stub)(entity))
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureForumTopicIcon) GetClass() string {
return ClassPremiumFeature
}
func (*PremiumFeatureForumTopicIcon) GetType() string {
return TypePremiumFeatureForumTopicIcon
}
func (*PremiumFeatureForumTopicIcon) PremiumFeatureType() string {
return TypePremiumFeatureForumTopicIcon
}
// Allowed to set a premium appllication icons
type PremiumFeatureAppIcons struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatureAppIcons) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatureAppIcons
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureAppIcons) GetClass() string {
return ClassPremiumFeature
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureAppIcons) GetType() string {
return TypePremiumFeatureAppIcons
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatureAppIcons) PremiumFeatureType() string {
return TypePremiumFeatureAppIcons
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains information about a limit, increased for Premium users
type PremiumLimit struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The type of the limit
Type PremiumLimitType `json:"type"`
// Default value of the limit
DefaultValue int32 `json:"default_value"`
// Value of the limit for Premium users
PremiumValue int32 `json:"premium_value"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumLimit) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumLimit
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimit) GetClass() string {
return ClassPremiumLimit
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumLimit) GetType() string {
return TypePremiumLimit
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (premiumLimit *PremiumLimit) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
2023-06-04 22:58:07 +02:00
Type json.RawMessage `json:"type"`
DefaultValue int32 `json:"default_value"`
PremiumValue int32 `json:"premium_value"`
2021-10-22 16:24:12 +02:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2023-06-04 22:58:07 +02:00
premiumLimit.DefaultValue = tmp.DefaultValue
premiumLimit.PremiumValue = tmp.PremiumValue
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
fieldType, _ := UnmarshalPremiumLimitType(tmp.Type)
premiumLimit.Type = fieldType
2021-10-22 16:24:12 +02:00
return nil
}
2023-06-04 22:58:07 +02:00
// Contains information about features, available to Premium users
type PremiumFeatures struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The list of available features
Features []PremiumFeature `json:"features"`
// The list of limits, increased for Premium users
Limits []*PremiumLimit `json:"limits"`
// An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available
PaymentLink InternalLinkType `json:"payment_link"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeatures) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeatures
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatures) GetClass() string {
return ClassPremiumFeatures
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeatures) GetType() string {
return TypePremiumFeatures
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (premiumFeatures *PremiumFeatures) UnmarshalJSON(data []byte) error {
var tmp struct {
Features []json.RawMessage `json:"features"`
Limits []*PremiumLimit `json:"limits"`
PaymentLink json.RawMessage `json:"payment_link"`
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
premiumFeatures.Limits = tmp.Limits
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
fieldFeatures, _ := UnmarshalListOfPremiumFeature(tmp.Features)
premiumFeatures.Features = fieldFeatures
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
fieldPaymentLink, _ := UnmarshalInternalLinkType(tmp.PaymentLink)
premiumFeatures.PaymentLink = fieldPaymentLink
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A limit was exceeded
type PremiumSourceLimitExceeded struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Type of the exceeded limit
LimitType PremiumLimitType `json:"limit_type"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumSourceLimitExceeded) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumSourceLimitExceeded
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceLimitExceeded) GetClass() string {
return ClassPremiumSource
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceLimitExceeded) GetType() string {
return TypePremiumSourceLimitExceeded
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceLimitExceeded) PremiumSourceType() string {
return TypePremiumSourceLimitExceeded
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (premiumSourceLimitExceeded *PremiumSourceLimitExceeded) UnmarshalJSON(data []byte) error {
var tmp struct {
LimitType json.RawMessage `json:"limit_type"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldLimitType, _ := UnmarshalPremiumLimitType(tmp.LimitType)
premiumSourceLimitExceeded.LimitType = fieldLimitType
return nil
}
// A user tried to use a Premium feature
type PremiumSourceFeature struct {
2021-12-08 10:23:00 +01:00
meta
2023-06-04 22:58:07 +02:00
// The used feature
Feature PremiumFeature `json:"feature"`
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumSourceFeature) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumSourceFeature
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceFeature) GetClass() string {
return ClassPremiumSource
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceFeature) GetType() string {
return TypePremiumSourceFeature
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceFeature) PremiumSourceType() string {
return TypePremiumSourceFeature
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (premiumSourceFeature *PremiumSourceFeature) UnmarshalJSON(data []byte) error {
var tmp struct {
Feature json.RawMessage `json:"feature"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldFeature, _ := UnmarshalPremiumFeature(tmp.Feature)
premiumSourceFeature.Feature = fieldFeature
return nil
}
// A user opened an internal link of the type internalLinkTypePremiumFeatures
type PremiumSourceLink struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The referrer from the link
Referrer string `json:"referrer"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumSourceLink) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumSourceLink
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceLink) GetClass() string {
return ClassPremiumSource
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceLink) GetType() string {
return TypePremiumSourceLink
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceLink) PremiumSourceType() string {
return TypePremiumSourceLink
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A user opened the Premium features screen from settings
type PremiumSourceSettings struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumSourceSettings) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumSourceSettings
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceSettings) GetClass() string {
return ClassPremiumSource
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceSettings) GetType() string {
return TypePremiumSourceSettings
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumSourceSettings) PremiumSourceType() string {
return TypePremiumSourceSettings
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Describes a promotion animation for a Premium feature
type PremiumFeaturePromotionAnimation struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Premium feature
Feature PremiumFeature `json:"feature"`
// Promotion animation for the feature
Animation *Animation `json:"animation"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumFeaturePromotionAnimation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumFeaturePromotionAnimation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeaturePromotionAnimation) GetClass() string {
return ClassPremiumFeaturePromotionAnimation
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumFeaturePromotionAnimation) GetType() string {
return TypePremiumFeaturePromotionAnimation
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (premiumFeaturePromotionAnimation *PremiumFeaturePromotionAnimation) UnmarshalJSON(data []byte) error {
var tmp struct {
Feature json.RawMessage `json:"feature"`
Animation *Animation `json:"animation"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
premiumFeaturePromotionAnimation.Animation = tmp.Animation
fieldFeature, _ := UnmarshalPremiumFeature(tmp.Feature)
premiumFeaturePromotionAnimation.Feature = fieldFeature
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains state of Telegram Premium subscription and promotion videos for Premium features
type PremiumState struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription
State *FormattedText `json:"state"`
// The list of available options for buying Telegram Premium
PaymentOptions []*PremiumPaymentOption `json:"payment_options"`
// The list of available promotion animations for Premium features
Animations []*PremiumFeaturePromotionAnimation `json:"animations"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PremiumState) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PremiumState
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PremiumState) GetClass() string {
return ClassPremiumState
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PremiumState) GetType() string {
return TypePremiumState
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// The user subscribed to Telegram Premium
type StorePaymentPurposePremiumSubscription struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Pass true if this is a restore of a Telegram Premium purchase; only for App Store
IsRestore bool `json:"is_restore"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *StorePaymentPurposePremiumSubscription) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub StorePaymentPurposePremiumSubscription
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*StorePaymentPurposePremiumSubscription) GetClass() string {
return ClassStorePaymentPurpose
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*StorePaymentPurposePremiumSubscription) GetType() string {
return TypeStorePaymentPurposePremiumSubscription
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*StorePaymentPurposePremiumSubscription) StorePaymentPurposeType() string {
return TypeStorePaymentPurposePremiumSubscription
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// The user gifted Telegram Premium to another user
type StorePaymentPurposeGiftedPremium struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Identifier of the user for which Premium was 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"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *StorePaymentPurposeGiftedPremium) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub StorePaymentPurposeGiftedPremium
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*StorePaymentPurposeGiftedPremium) GetClass() string {
return ClassStorePaymentPurpose
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*StorePaymentPurposeGiftedPremium) GetType() string {
return TypeStorePaymentPurposeGiftedPremium
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*StorePaymentPurposeGiftedPremium) StorePaymentPurposeType() string {
return TypeStorePaymentPurposeGiftedPremium
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// A token for Firebase Cloud Messaging
type DeviceTokenFirebaseCloudMessaging struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Device registration token; may be empty to deregister a device
Token string `json:"token"`
// True, if push notifications must be additionally encrypted
Encrypt bool `json:"encrypt"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *DeviceTokenFirebaseCloudMessaging) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub DeviceTokenFirebaseCloudMessaging
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenFirebaseCloudMessaging) GetClass() string {
return ClassDeviceToken
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenFirebaseCloudMessaging) GetType() string {
return TypeDeviceTokenFirebaseCloudMessaging
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenFirebaseCloudMessaging) DeviceTokenType() string {
return TypeDeviceTokenFirebaseCloudMessaging
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A token for Apple Push Notification service
type DeviceTokenApplePush struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Device token; may be empty to deregister a device
DeviceToken string `json:"device_token"`
// True, if App Sandbox is enabled
IsAppSandbox bool `json:"is_app_sandbox"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *DeviceTokenApplePush) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub DeviceTokenApplePush
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenApplePush) GetClass() string {
return ClassDeviceToken
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenApplePush) GetType() string {
return TypeDeviceTokenApplePush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenApplePush) DeviceTokenType() string {
return TypeDeviceTokenApplePush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A token for Apple Push Notification service VoIP notifications
type DeviceTokenApplePushVoIP struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Device token; may be empty to deregister a device
DeviceToken string `json:"device_token"`
// True, if App Sandbox is enabled
IsAppSandbox bool `json:"is_app_sandbox"`
// True, if push notifications must be additionally encrypted
Encrypt bool `json:"encrypt"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *DeviceTokenApplePushVoIP) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub DeviceTokenApplePushVoIP
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenApplePushVoIP) GetClass() string {
return ClassDeviceToken
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenApplePushVoIP) GetType() string {
return TypeDeviceTokenApplePushVoIP
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenApplePushVoIP) DeviceTokenType() string {
return TypeDeviceTokenApplePushVoIP
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A token for Windows Push Notification Services
type DeviceTokenWindowsPush struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The access token that will be used to send notifications; may be empty to deregister a device
AccessToken string `json:"access_token"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *DeviceTokenWindowsPush) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub DeviceTokenWindowsPush
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenWindowsPush) GetClass() string {
return ClassDeviceToken
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenWindowsPush) GetType() string {
return TypeDeviceTokenWindowsPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenWindowsPush) DeviceTokenType() string {
return TypeDeviceTokenWindowsPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A token for Microsoft Push Notification Service
type DeviceTokenMicrosoftPush struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Push notification channel URI; may be empty to deregister a device
ChannelUri string `json:"channel_uri"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *DeviceTokenMicrosoftPush) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub DeviceTokenMicrosoftPush
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenMicrosoftPush) GetClass() string {
return ClassDeviceToken
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenMicrosoftPush) GetType() string {
return TypeDeviceTokenMicrosoftPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenMicrosoftPush) DeviceTokenType() string {
return TypeDeviceTokenMicrosoftPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A token for Microsoft Push Notification Service VoIP channel
type DeviceTokenMicrosoftPushVoIP struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Push notification channel URI; may be empty to deregister a device
ChannelUri string `json:"channel_uri"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *DeviceTokenMicrosoftPushVoIP) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub DeviceTokenMicrosoftPushVoIP
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenMicrosoftPushVoIP) GetClass() string {
return ClassDeviceToken
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenMicrosoftPushVoIP) GetType() string {
return TypeDeviceTokenMicrosoftPushVoIP
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenMicrosoftPushVoIP) DeviceTokenType() string {
return TypeDeviceTokenMicrosoftPushVoIP
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A token for web Push API
type DeviceTokenWebPush struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device
Endpoint string `json:"endpoint"`
// Base64url-encoded P-256 elliptic curve Diffie-Hellman public key
P256dhBase64url string `json:"p256dh_base64url"`
// Base64url-encoded authentication secret
AuthBase64url string `json:"auth_base64url"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *DeviceTokenWebPush) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub DeviceTokenWebPush
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenWebPush) GetClass() string {
return ClassDeviceToken
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenWebPush) GetType() string {
return TypeDeviceTokenWebPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenWebPush) DeviceTokenType() string {
return TypeDeviceTokenWebPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A token for Simple Push API for Firefox OS
type DeviceTokenSimplePush struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device
Endpoint string `json:"endpoint"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *DeviceTokenSimplePush) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub DeviceTokenSimplePush
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenSimplePush) GetClass() string {
return ClassDeviceToken
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenSimplePush) GetType() string {
return TypeDeviceTokenSimplePush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenSimplePush) DeviceTokenType() string {
return TypeDeviceTokenSimplePush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A token for Ubuntu Push Client service
type DeviceTokenUbuntuPush struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Token; may be empty to deregister a device
Token string `json:"token"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *DeviceTokenUbuntuPush) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub DeviceTokenUbuntuPush
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenUbuntuPush) GetClass() string {
return ClassDeviceToken
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenUbuntuPush) GetType() string {
return TypeDeviceTokenUbuntuPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenUbuntuPush) DeviceTokenType() string {
return TypeDeviceTokenUbuntuPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A token for BlackBerry Push Service
type DeviceTokenBlackBerryPush struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Token; may be empty to deregister a device
Token string `json:"token"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *DeviceTokenBlackBerryPush) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub DeviceTokenBlackBerryPush
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenBlackBerryPush) GetClass() string {
return ClassDeviceToken
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenBlackBerryPush) GetType() string {
return TypeDeviceTokenBlackBerryPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenBlackBerryPush) DeviceTokenType() string {
return TypeDeviceTokenBlackBerryPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A token for Tizen Push Service
type DeviceTokenTizenPush struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Push service registration identifier; may be empty to deregister a device
RegId string `json:"reg_id"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *DeviceTokenTizenPush) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub DeviceTokenTizenPush
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenTizenPush) GetClass() string {
return ClassDeviceToken
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenTizenPush) GetType() string {
return TypeDeviceTokenTizenPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*DeviceTokenTizenPush) DeviceTokenType() string {
return TypeDeviceTokenTizenPush
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification
type PushReceiverId struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The globally unique identifier of push notification subscription
Id JsonInt64 `json:"id"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PushReceiverId) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PushReceiverId
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PushReceiverId) GetClass() string {
return ClassPushReceiverId
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PushReceiverId) GetType() string {
return TypePushReceiverId
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// Describes a solid fill of a background
type BackgroundFillSolid struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// A color of the background in the RGB24 format
Color int32 `json:"color"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *BackgroundFillSolid) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub BackgroundFillSolid
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*BackgroundFillSolid) GetClass() string {
return ClassBackgroundFill
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*BackgroundFillSolid) GetType() string {
return TypeBackgroundFillSolid
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*BackgroundFillSolid) BackgroundFillType() string {
return TypeBackgroundFillSolid
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Describes a gradient fill of a background
type BackgroundFillGradient struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// A top color of the background in the RGB24 format
TopColor int32 `json:"top_color"`
// A bottom color of the background in the RGB24 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"`
}
func (entity *BackgroundFillGradient) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BackgroundFillGradient
return json.Marshal((*stub)(entity))
}
func (*BackgroundFillGradient) GetClass() string {
return ClassBackgroundFill
}
func (*BackgroundFillGradient) GetType() string {
return TypeBackgroundFillGradient
}
func (*BackgroundFillGradient) BackgroundFillType() string {
return TypeBackgroundFillGradient
}
// Describes a freeform gradient fill of a background
type BackgroundFillFreeformGradient struct {
meta
// A list of 3 or 4 colors of the freeform gradients in the RGB24 format
Colors []int32 `json:"colors"`
}
func (entity *BackgroundFillFreeformGradient) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BackgroundFillFreeformGradient
return json.Marshal((*stub)(entity))
}
func (*BackgroundFillFreeformGradient) GetClass() string {
return ClassBackgroundFill
}
func (*BackgroundFillFreeformGradient) GetType() string {
return TypeBackgroundFillFreeformGradient
}
func (*BackgroundFillFreeformGradient) BackgroundFillType() string {
return TypeBackgroundFillFreeformGradient
}
// A wallpaper in JPEG format
type BackgroundTypeWallpaper struct {
meta
// True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12
IsBlurred bool `json:"is_blurred"`
// True, if the background needs to be slightly moved when device is tilted
IsMoving bool `json:"is_moving"`
}
func (entity *BackgroundTypeWallpaper) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BackgroundTypeWallpaper
return json.Marshal((*stub)(entity))
}
func (*BackgroundTypeWallpaper) GetClass() string {
return ClassBackgroundType
}
func (*BackgroundTypeWallpaper) GetType() string {
return TypeBackgroundTypeWallpaper
}
func (*BackgroundTypeWallpaper) BackgroundTypeType() string {
return TypeBackgroundTypeWallpaper
}
// A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user
type BackgroundTypePattern struct {
meta
// Fill of the background
Fill BackgroundFill `json:"fill"`
// Intensity of the pattern when it is shown above the filled background; 0-100.
Intensity int32 `json:"intensity"`
// True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only
IsInverted bool `json:"is_inverted"`
// True, if the background needs to be slightly moved when device is tilted
IsMoving bool `json:"is_moving"`
}
func (entity *BackgroundTypePattern) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BackgroundTypePattern
return json.Marshal((*stub)(entity))
}
func (*BackgroundTypePattern) GetClass() string {
return ClassBackgroundType
}
func (*BackgroundTypePattern) GetType() string {
return TypeBackgroundTypePattern
}
func (*BackgroundTypePattern) BackgroundTypeType() string {
return TypeBackgroundTypePattern
}
func (backgroundTypePattern *BackgroundTypePattern) UnmarshalJSON(data []byte) error {
var tmp struct {
Fill json.RawMessage `json:"fill"`
Intensity int32 `json:"intensity"`
IsInverted bool `json:"is_inverted"`
IsMoving bool `json:"is_moving"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
backgroundTypePattern.Intensity = tmp.Intensity
backgroundTypePattern.IsInverted = tmp.IsInverted
backgroundTypePattern.IsMoving = tmp.IsMoving
fieldFill, _ := UnmarshalBackgroundFill(tmp.Fill)
backgroundTypePattern.Fill = fieldFill
return nil
}
// A filled background
type BackgroundTypeFill struct {
meta
// The background fill
Fill BackgroundFill `json:"fill"`
}
func (entity *BackgroundTypeFill) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BackgroundTypeFill
return json.Marshal((*stub)(entity))
}
func (*BackgroundTypeFill) GetClass() string {
return ClassBackgroundType
}
func (*BackgroundTypeFill) GetType() string {
return TypeBackgroundTypeFill
}
func (*BackgroundTypeFill) BackgroundTypeType() string {
return TypeBackgroundTypeFill
}
func (backgroundTypeFill *BackgroundTypeFill) UnmarshalJSON(data []byte) error {
var tmp struct {
Fill json.RawMessage `json:"fill"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldFill, _ := UnmarshalBackgroundFill(tmp.Fill)
backgroundTypeFill.Fill = fieldFill
return nil
}
// Describes a chat background
type Background struct {
meta
// Unique background identifier
Id JsonInt64 `json:"id"`
// True, if this is one of default backgrounds
IsDefault bool `json:"is_default"`
// True, if the background is dark and is recommended to be used with dark theme
IsDark bool `json:"is_dark"`
// Unique background name
2021-12-08 10:23:00 +01:00
Name string `json:"name"`
2023-06-04 22:58:07 +02:00
// Document with the background; may be null. Null only for filled backgrounds
Document *Document `json:"document"`
// Type of the background
Type BackgroundType `json:"type"`
}
func (entity *Background) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Background
return json.Marshal((*stub)(entity))
}
func (*Background) GetClass() string {
return ClassBackground
}
func (*Background) GetType() string {
return TypeBackground
}
func (background *Background) UnmarshalJSON(data []byte) error {
var tmp struct {
Id JsonInt64 `json:"id"`
IsDefault bool `json:"is_default"`
IsDark bool `json:"is_dark"`
Name string `json:"name"`
Document *Document `json:"document"`
Type json.RawMessage `json:"type"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
background.Id = tmp.Id
background.IsDefault = tmp.IsDefault
background.IsDark = tmp.IsDark
background.Name = tmp.Name
background.Document = tmp.Document
fieldType, _ := UnmarshalBackgroundType(tmp.Type)
background.Type = fieldType
return nil
}
// Contains a list of backgrounds
type Backgrounds struct {
meta
// A list of backgrounds
Backgrounds []*Background `json:"backgrounds"`
}
func (entity *Backgrounds) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Backgrounds
return json.Marshal((*stub)(entity))
}
func (*Backgrounds) GetClass() string {
return ClassBackgrounds
}
func (*Backgrounds) GetType() string {
return TypeBackgrounds
}
// A background from a local file
type InputBackgroundLocal struct {
meta
// Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file must be in JPEG format for wallpapers and in PNG format for patterns
Background InputFile `json:"background"`
}
func (entity *InputBackgroundLocal) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputBackgroundLocal
return json.Marshal((*stub)(entity))
}
func (*InputBackgroundLocal) GetClass() string {
return ClassInputBackground
}
func (*InputBackgroundLocal) GetType() string {
return TypeInputBackgroundLocal
}
func (*InputBackgroundLocal) InputBackgroundType() string {
return TypeInputBackgroundLocal
}
func (inputBackgroundLocal *InputBackgroundLocal) UnmarshalJSON(data []byte) error {
var tmp struct {
Background json.RawMessage `json:"background"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldBackground, _ := UnmarshalInputFile(tmp.Background)
inputBackgroundLocal.Background = fieldBackground
return nil
}
// A background from the server
type InputBackgroundRemote struct {
meta
// The background identifier
BackgroundId JsonInt64 `json:"background_id"`
}
func (entity *InputBackgroundRemote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputBackgroundRemote
return json.Marshal((*stub)(entity))
}
func (*InputBackgroundRemote) GetClass() string {
return ClassInputBackground
}
func (*InputBackgroundRemote) GetType() string {
return TypeInputBackgroundRemote
}
func (*InputBackgroundRemote) InputBackgroundType() string {
return TypeInputBackgroundRemote
}
// Describes theme settings
type ThemeSettings struct {
meta
// Theme accent color in ARGB format
AccentColor int32 `json:"accent_color"`
// The background to be used in chats; may be null
Background *Background `json:"background"`
// The fill to be used as a background for outgoing messages
OutgoingMessageFill BackgroundFill `json:"outgoing_message_fill"`
// If true, the freeform gradient fill needs to be animated on every sent message
AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"`
// Accent color of outgoing messages in ARGB format
OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"`
}
func (entity *ThemeSettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ThemeSettings
return json.Marshal((*stub)(entity))
}
func (*ThemeSettings) GetClass() string {
return ClassThemeSettings
}
func (*ThemeSettings) GetType() string {
return TypeThemeSettings
}
func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error {
var tmp struct {
AccentColor int32 `json:"accent_color"`
Background *Background `json:"background"`
OutgoingMessageFill json.RawMessage `json:"outgoing_message_fill"`
AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"`
OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
themeSettings.AccentColor = tmp.AccentColor
themeSettings.Background = tmp.Background
themeSettings.AnimateOutgoingMessageFill = tmp.AnimateOutgoingMessageFill
themeSettings.OutgoingMessageAccentColor = tmp.OutgoingMessageAccentColor
fieldOutgoingMessageFill, _ := UnmarshalBackgroundFill(tmp.OutgoingMessageFill)
themeSettings.OutgoingMessageFill = fieldOutgoingMessageFill
return nil
}
// Describes a chat theme
type ChatTheme struct {
meta
// Theme name
Name string `json:"name"`
// Theme settings for a light chat theme
LightSettings *ThemeSettings `json:"light_settings"`
// Theme settings for a dark chat theme
DarkSettings *ThemeSettings `json:"dark_settings"`
}
func (entity *ChatTheme) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatTheme
return json.Marshal((*stub)(entity))
}
func (*ChatTheme) GetClass() string {
return ClassChatTheme
}
func (*ChatTheme) GetType() string {
return TypeChatTheme
}
// Contains a list of hashtags
type Hashtags struct {
meta
// A list of hashtags
Hashtags []string `json:"hashtags"`
}
func (entity *Hashtags) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Hashtags
return json.Marshal((*stub)(entity))
}
func (*Hashtags) GetClass() string {
return ClassHashtags
}
func (*Hashtags) GetType() string {
return TypeHashtags
}
// The session can be used
type CanTransferOwnershipResultOk struct {
meta
}
func (entity *CanTransferOwnershipResultOk) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CanTransferOwnershipResultOk
return json.Marshal((*stub)(entity))
}
func (*CanTransferOwnershipResultOk) GetClass() string {
return ClassCanTransferOwnershipResult
}
func (*CanTransferOwnershipResultOk) GetType() string {
return TypeCanTransferOwnershipResultOk
}
func (*CanTransferOwnershipResultOk) CanTransferOwnershipResultType() string {
return TypeCanTransferOwnershipResultOk
}
// The 2-step verification needs to be enabled first
type CanTransferOwnershipResultPasswordNeeded struct {
meta
}
func (entity *CanTransferOwnershipResultPasswordNeeded) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CanTransferOwnershipResultPasswordNeeded
return json.Marshal((*stub)(entity))
}
func (*CanTransferOwnershipResultPasswordNeeded) GetClass() string {
return ClassCanTransferOwnershipResult
}
func (*CanTransferOwnershipResultPasswordNeeded) GetType() string {
return TypeCanTransferOwnershipResultPasswordNeeded
}
func (*CanTransferOwnershipResultPasswordNeeded) CanTransferOwnershipResultType() string {
return TypeCanTransferOwnershipResultPasswordNeeded
}
// The 2-step verification was enabled recently, user needs to wait
type CanTransferOwnershipResultPasswordTooFresh struct {
meta
// Time left before the session can be used to transfer ownership of a chat, in seconds
RetryAfter int32 `json:"retry_after"`
}
func (entity *CanTransferOwnershipResultPasswordTooFresh) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CanTransferOwnershipResultPasswordTooFresh
return json.Marshal((*stub)(entity))
}
func (*CanTransferOwnershipResultPasswordTooFresh) GetClass() string {
return ClassCanTransferOwnershipResult
}
func (*CanTransferOwnershipResultPasswordTooFresh) GetType() string {
return TypeCanTransferOwnershipResultPasswordTooFresh
}
func (*CanTransferOwnershipResultPasswordTooFresh) CanTransferOwnershipResultType() string {
return TypeCanTransferOwnershipResultPasswordTooFresh
}
// The session was created recently, user needs to wait
type CanTransferOwnershipResultSessionTooFresh struct {
meta
// Time left before the session can be used to transfer ownership of a chat, in seconds
RetryAfter int32 `json:"retry_after"`
}
func (entity *CanTransferOwnershipResultSessionTooFresh) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CanTransferOwnershipResultSessionTooFresh
return json.Marshal((*stub)(entity))
}
func (*CanTransferOwnershipResultSessionTooFresh) GetClass() string {
return ClassCanTransferOwnershipResult
}
func (*CanTransferOwnershipResultSessionTooFresh) GetType() string {
return TypeCanTransferOwnershipResultSessionTooFresh
}
func (*CanTransferOwnershipResultSessionTooFresh) CanTransferOwnershipResultType() string {
return TypeCanTransferOwnershipResultSessionTooFresh
}
// The username can be set
type CheckChatUsernameResultOk struct {
meta
}
func (entity *CheckChatUsernameResultOk) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CheckChatUsernameResultOk
return json.Marshal((*stub)(entity))
}
func (*CheckChatUsernameResultOk) GetClass() string {
return ClassCheckChatUsernameResult
}
func (*CheckChatUsernameResultOk) GetType() string {
return TypeCheckChatUsernameResultOk
}
func (*CheckChatUsernameResultOk) CheckChatUsernameResultType() string {
return TypeCheckChatUsernameResultOk
}
// The username is invalid
type CheckChatUsernameResultUsernameInvalid struct {
meta
}
func (entity *CheckChatUsernameResultUsernameInvalid) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CheckChatUsernameResultUsernameInvalid
return json.Marshal((*stub)(entity))
}
func (*CheckChatUsernameResultUsernameInvalid) GetClass() string {
return ClassCheckChatUsernameResult
}
func (*CheckChatUsernameResultUsernameInvalid) GetType() string {
return TypeCheckChatUsernameResultUsernameInvalid
}
func (*CheckChatUsernameResultUsernameInvalid) CheckChatUsernameResultType() string {
return TypeCheckChatUsernameResultUsernameInvalid
}
// The username is occupied
type CheckChatUsernameResultUsernameOccupied struct {
meta
}
func (entity *CheckChatUsernameResultUsernameOccupied) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CheckChatUsernameResultUsernameOccupied
return json.Marshal((*stub)(entity))
}
func (*CheckChatUsernameResultUsernameOccupied) GetClass() string {
return ClassCheckChatUsernameResult
}
func (*CheckChatUsernameResultUsernameOccupied) GetType() string {
return TypeCheckChatUsernameResultUsernameOccupied
}
func (*CheckChatUsernameResultUsernameOccupied) CheckChatUsernameResultType() string {
return TypeCheckChatUsernameResultUsernameOccupied
}
// The username can be purchased at fragment.com
type CheckChatUsernameResultUsernamePurchasable struct {
meta
}
func (entity *CheckChatUsernameResultUsernamePurchasable) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CheckChatUsernameResultUsernamePurchasable
return json.Marshal((*stub)(entity))
}
func (*CheckChatUsernameResultUsernamePurchasable) GetClass() string {
return ClassCheckChatUsernameResult
}
func (*CheckChatUsernameResultUsernamePurchasable) GetType() string {
return TypeCheckChatUsernameResultUsernamePurchasable
}
func (*CheckChatUsernameResultUsernamePurchasable) CheckChatUsernameResultType() string {
return TypeCheckChatUsernameResultUsernamePurchasable
}
// The user has too many chats with username, one of them must be made private first
type CheckChatUsernameResultPublicChatsTooMany struct {
meta
}
func (entity *CheckChatUsernameResultPublicChatsTooMany) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CheckChatUsernameResultPublicChatsTooMany
return json.Marshal((*stub)(entity))
}
func (*CheckChatUsernameResultPublicChatsTooMany) GetClass() string {
return ClassCheckChatUsernameResult
}
func (*CheckChatUsernameResultPublicChatsTooMany) GetType() string {
return TypeCheckChatUsernameResultPublicChatsTooMany
}
func (*CheckChatUsernameResultPublicChatsTooMany) CheckChatUsernameResultType() string {
return TypeCheckChatUsernameResultPublicChatsTooMany
}
// The user can't be a member of a public supergroup
type CheckChatUsernameResultPublicGroupsUnavailable struct {
meta
}
func (entity *CheckChatUsernameResultPublicGroupsUnavailable) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CheckChatUsernameResultPublicGroupsUnavailable
return json.Marshal((*stub)(entity))
}
func (*CheckChatUsernameResultPublicGroupsUnavailable) GetClass() string {
return ClassCheckChatUsernameResult
}
func (*CheckChatUsernameResultPublicGroupsUnavailable) GetType() string {
return TypeCheckChatUsernameResultPublicGroupsUnavailable
}
func (*CheckChatUsernameResultPublicGroupsUnavailable) CheckChatUsernameResultType() string {
return TypeCheckChatUsernameResultPublicGroupsUnavailable
}
// The name can be set
type CheckStickerSetNameResultOk struct {
meta
}
func (entity *CheckStickerSetNameResultOk) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CheckStickerSetNameResultOk
return json.Marshal((*stub)(entity))
}
func (*CheckStickerSetNameResultOk) GetClass() string {
return ClassCheckStickerSetNameResult
}
func (*CheckStickerSetNameResultOk) GetType() string {
return TypeCheckStickerSetNameResultOk
}
func (*CheckStickerSetNameResultOk) CheckStickerSetNameResultType() string {
return TypeCheckStickerSetNameResultOk
}
// The name is invalid
type CheckStickerSetNameResultNameInvalid struct {
meta
}
func (entity *CheckStickerSetNameResultNameInvalid) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CheckStickerSetNameResultNameInvalid
return json.Marshal((*stub)(entity))
}
func (*CheckStickerSetNameResultNameInvalid) GetClass() string {
return ClassCheckStickerSetNameResult
}
func (*CheckStickerSetNameResultNameInvalid) GetType() string {
return TypeCheckStickerSetNameResultNameInvalid
}
func (*CheckStickerSetNameResultNameInvalid) CheckStickerSetNameResultType() string {
return TypeCheckStickerSetNameResultNameInvalid
}
// The name is occupied
type CheckStickerSetNameResultNameOccupied struct {
meta
}
func (entity *CheckStickerSetNameResultNameOccupied) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CheckStickerSetNameResultNameOccupied
return json.Marshal((*stub)(entity))
}
func (*CheckStickerSetNameResultNameOccupied) GetClass() string {
return ClassCheckStickerSetNameResult
}
func (*CheckStickerSetNameResultNameOccupied) GetType() string {
return TypeCheckStickerSetNameResultNameOccupied
}
func (*CheckStickerSetNameResultNameOccupied) CheckStickerSetNameResultType() string {
return TypeCheckStickerSetNameResultNameOccupied
}
// The password was reset
type ResetPasswordResultOk struct {
meta
}
func (entity *ResetPasswordResultOk) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ResetPasswordResultOk
return json.Marshal((*stub)(entity))
}
func (*ResetPasswordResultOk) GetClass() string {
return ClassResetPasswordResult
}
func (*ResetPasswordResultOk) GetType() string {
return TypeResetPasswordResultOk
}
func (*ResetPasswordResultOk) ResetPasswordResultType() string {
return TypeResetPasswordResultOk
}
// The password reset request is pending
type ResetPasswordResultPending struct {
meta
// Point in time (Unix timestamp) after which the password can be reset immediately using resetPassword
PendingResetDate int32 `json:"pending_reset_date"`
}
func (entity *ResetPasswordResultPending) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ResetPasswordResultPending
return json.Marshal((*stub)(entity))
}
func (*ResetPasswordResultPending) GetClass() string {
return ClassResetPasswordResult
}
func (*ResetPasswordResultPending) GetType() string {
return TypeResetPasswordResultPending
}
func (*ResetPasswordResultPending) ResetPasswordResultType() string {
return TypeResetPasswordResultPending
}
// The password reset request was declined
type ResetPasswordResultDeclined struct {
meta
// Point in time (Unix timestamp) when the password reset can be retried
RetryDate int32 `json:"retry_date"`
}
func (entity *ResetPasswordResultDeclined) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ResetPasswordResultDeclined
return json.Marshal((*stub)(entity))
}
func (*ResetPasswordResultDeclined) GetClass() string {
return ClassResetPasswordResult
}
func (*ResetPasswordResultDeclined) GetType() string {
return TypeResetPasswordResultDeclined
}
func (*ResetPasswordResultDeclined) ResetPasswordResultType() string {
return TypeResetPasswordResultDeclined
}
// The messages was exported from a private chat
type MessageFileTypePrivate struct {
meta
// Name of the other party; may be empty if unrecognized
Name string `json:"name"`
}
func (entity *MessageFileTypePrivate) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageFileTypePrivate
return json.Marshal((*stub)(entity))
}
func (*MessageFileTypePrivate) GetClass() string {
return ClassMessageFileType
}
func (*MessageFileTypePrivate) GetType() string {
return TypeMessageFileTypePrivate
}
func (*MessageFileTypePrivate) MessageFileTypeType() string {
return TypeMessageFileTypePrivate
}
// The messages was exported from a group chat
type MessageFileTypeGroup struct {
meta
// Title of the group chat; may be empty if unrecognized
Title string `json:"title"`
}
func (entity *MessageFileTypeGroup) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageFileTypeGroup
return json.Marshal((*stub)(entity))
}
func (*MessageFileTypeGroup) GetClass() string {
return ClassMessageFileType
}
func (*MessageFileTypeGroup) GetType() string {
return TypeMessageFileTypeGroup
}
func (*MessageFileTypeGroup) MessageFileTypeType() string {
return TypeMessageFileTypeGroup
}
// The messages was exported from a chat of unknown type
type MessageFileTypeUnknown struct {
meta
}
func (entity *MessageFileTypeUnknown) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageFileTypeUnknown
return json.Marshal((*stub)(entity))
}
func (*MessageFileTypeUnknown) GetClass() string {
return ClassMessageFileType
}
func (*MessageFileTypeUnknown) GetType() string {
return TypeMessageFileTypeUnknown
}
func (*MessageFileTypeUnknown) MessageFileTypeType() string {
return TypeMessageFileTypeUnknown
}
// A general message with hidden content
type PushMessageContentHidden struct {
meta
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentHidden) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentHidden
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentHidden) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentHidden) GetType() string {
return TypePushMessageContentHidden
}
func (*PushMessageContentHidden) PushMessageContentType() string {
return TypePushMessageContentHidden
}
// An animation message (GIF-style).
type PushMessageContentAnimation struct {
meta
// Message content; may be null
Animation *Animation `json:"animation"`
// Animation caption
Caption string `json:"caption"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentAnimation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentAnimation
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentAnimation) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentAnimation) GetType() string {
return TypePushMessageContentAnimation
}
func (*PushMessageContentAnimation) PushMessageContentType() string {
return TypePushMessageContentAnimation
}
// An audio message
type PushMessageContentAudio struct {
meta
// Message content; may be null
Audio *Audio `json:"audio"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentAudio) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentAudio
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentAudio) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentAudio) GetType() string {
return TypePushMessageContentAudio
}
func (*PushMessageContentAudio) PushMessageContentType() string {
return TypePushMessageContentAudio
}
// A message with a user contact
type PushMessageContentContact struct {
meta
// Contact's name
Name string `json:"name"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentContact) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentContact
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentContact) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentContact) GetType() string {
return TypePushMessageContentContact
}
func (*PushMessageContentContact) PushMessageContentType() string {
return TypePushMessageContentContact
}
// A contact has registered with Telegram
type PushMessageContentContactRegistered struct {
meta
}
func (entity *PushMessageContentContactRegistered) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentContactRegistered
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentContactRegistered) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentContactRegistered) GetType() string {
return TypePushMessageContentContactRegistered
}
func (*PushMessageContentContactRegistered) PushMessageContentType() string {
return TypePushMessageContentContactRegistered
}
// A document message (a general file)
type PushMessageContentDocument struct {
meta
// Message content; may be null
Document *Document `json:"document"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentDocument) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentDocument
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentDocument) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentDocument) GetType() string {
return TypePushMessageContentDocument
}
func (*PushMessageContentDocument) PushMessageContentType() string {
return TypePushMessageContentDocument
}
// A message with a game
type PushMessageContentGame struct {
meta
// Game title, empty for pinned game message
Title string `json:"title"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentGame) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentGame
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentGame) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentGame) GetType() string {
return TypePushMessageContentGame
}
func (*PushMessageContentGame) PushMessageContentType() string {
return TypePushMessageContentGame
}
// A new high score was achieved in a game
type PushMessageContentGameScore struct {
meta
// Game title, empty for pinned message
Title string `json:"title"`
// New score, 0 for pinned message
Score int32 `json:"score"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentGameScore) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentGameScore
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentGameScore) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentGameScore) GetType() string {
return TypePushMessageContentGameScore
}
func (*PushMessageContentGameScore) PushMessageContentType() string {
return TypePushMessageContentGameScore
}
// A message with an invoice from a bot
type PushMessageContentInvoice struct {
meta
// Product price
Price string `json:"price"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentInvoice) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentInvoice
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentInvoice) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentInvoice) GetType() string {
return TypePushMessageContentInvoice
}
func (*PushMessageContentInvoice) PushMessageContentType() string {
return TypePushMessageContentInvoice
}
// A message with a location
type PushMessageContentLocation struct {
meta
// True, if the location is live
IsLive bool `json:"is_live"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentLocation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentLocation
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentLocation) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentLocation) GetType() string {
return TypePushMessageContentLocation
}
func (*PushMessageContentLocation) PushMessageContentType() string {
return TypePushMessageContentLocation
}
// A photo message
type PushMessageContentPhoto struct {
meta
// Message content; may be null
Photo *Photo `json:"photo"`
// Photo caption
Caption string `json:"caption"`
// True, if the photo is secret
IsSecret bool `json:"is_secret"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentPhoto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentPhoto
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentPhoto) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentPhoto) GetType() string {
return TypePushMessageContentPhoto
}
func (*PushMessageContentPhoto) PushMessageContentType() string {
return TypePushMessageContentPhoto
}
// A message with a poll
type PushMessageContentPoll struct {
meta
// Poll question
Question string `json:"question"`
// True, if the poll is regular and not in quiz mode
IsRegular bool `json:"is_regular"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentPoll) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentPoll
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentPoll) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentPoll) GetType() string {
return TypePushMessageContentPoll
}
func (*PushMessageContentPoll) PushMessageContentType() string {
return TypePushMessageContentPoll
}
// A screenshot of a message in the chat has been taken
type PushMessageContentScreenshotTaken struct {
meta
}
func (entity *PushMessageContentScreenshotTaken) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentScreenshotTaken
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentScreenshotTaken) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentScreenshotTaken) GetType() string {
return TypePushMessageContentScreenshotTaken
}
func (*PushMessageContentScreenshotTaken) PushMessageContentType() string {
return TypePushMessageContentScreenshotTaken
}
// A message with a sticker
type PushMessageContentSticker struct {
meta
// Message content; may be null
Sticker *Sticker `json:"sticker"`
// Emoji corresponding to the sticker; may be empty
Emoji string `json:"emoji"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentSticker) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentSticker
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentSticker) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentSticker) GetType() string {
return TypePushMessageContentSticker
}
func (*PushMessageContentSticker) PushMessageContentType() string {
return TypePushMessageContentSticker
}
// A text message
type PushMessageContentText struct {
meta
// Message text
Text string `json:"text"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentText) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentText
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentText) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentText) GetType() string {
return TypePushMessageContentText
}
func (*PushMessageContentText) PushMessageContentType() string {
return TypePushMessageContentText
}
// A video message
type PushMessageContentVideo struct {
meta
// Message content; may be null
Video *Video `json:"video"`
// Video caption
Caption string `json:"caption"`
// True, if the video is secret
IsSecret bool `json:"is_secret"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentVideo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentVideo
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentVideo) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentVideo) GetType() string {
return TypePushMessageContentVideo
}
func (*PushMessageContentVideo) PushMessageContentType() string {
return TypePushMessageContentVideo
}
// A video note message
type PushMessageContentVideoNote struct {
meta
// Message content; may be null
VideoNote *VideoNote `json:"video_note"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
func (entity *PushMessageContentVideoNote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentVideoNote
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentVideoNote) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentVideoNote) GetType() string {
return TypePushMessageContentVideoNote
}
func (*PushMessageContentVideoNote) PushMessageContentType() string {
return TypePushMessageContentVideoNote
}
// A voice note message
type PushMessageContentVoiceNote struct {
meta
// Message content; may be null
VoiceNote *VoiceNote `json:"voice_note"`
2021-12-08 10:23:00 +01:00
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PushMessageContentVoiceNote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentVoiceNote
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentVoiceNote) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentVoiceNote) GetType() string {
return TypePushMessageContentVoiceNote
}
func (*PushMessageContentVoiceNote) PushMessageContentType() string {
return TypePushMessageContentVoiceNote
}
// A newly created basic group
type PushMessageContentBasicGroupChatCreate struct {
meta
}
func (entity *PushMessageContentBasicGroupChatCreate) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentBasicGroupChatCreate
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentBasicGroupChatCreate) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentBasicGroupChatCreate) GetType() string {
return TypePushMessageContentBasicGroupChatCreate
}
func (*PushMessageContentBasicGroupChatCreate) PushMessageContentType() string {
return TypePushMessageContentBasicGroupChatCreate
}
// New chat members were invited to a group
type PushMessageContentChatAddMembers struct {
meta
// Name of the added member
MemberName string `json:"member_name"`
// True, if the current user was added to the group
IsCurrentUser bool `json:"is_current_user"`
// True, if the user has returned to the group themselves
IsReturned bool `json:"is_returned"`
}
func (entity *PushMessageContentChatAddMembers) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentChatAddMembers
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentChatAddMembers) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentChatAddMembers) GetType() string {
return TypePushMessageContentChatAddMembers
}
func (*PushMessageContentChatAddMembers) PushMessageContentType() string {
return TypePushMessageContentChatAddMembers
}
// A chat photo was edited
type PushMessageContentChatChangePhoto struct {
meta
}
func (entity *PushMessageContentChatChangePhoto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentChatChangePhoto
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentChatChangePhoto) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentChatChangePhoto) GetType() string {
return TypePushMessageContentChatChangePhoto
}
func (*PushMessageContentChatChangePhoto) PushMessageContentType() string {
return TypePushMessageContentChatChangePhoto
}
// A chat title was edited
type PushMessageContentChatChangeTitle struct {
meta
// New chat title
Title string `json:"title"`
}
func (entity *PushMessageContentChatChangeTitle) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentChatChangeTitle
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentChatChangeTitle) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentChatChangeTitle) GetType() string {
return TypePushMessageContentChatChangeTitle
}
func (*PushMessageContentChatChangeTitle) PushMessageContentType() string {
return TypePushMessageContentChatChangeTitle
}
// A chat theme was edited
type PushMessageContentChatSetTheme struct {
meta
// If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one
ThemeName string `json:"theme_name"`
}
func (entity *PushMessageContentChatSetTheme) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentChatSetTheme
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentChatSetTheme) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentChatSetTheme) GetType() string {
return TypePushMessageContentChatSetTheme
}
func (*PushMessageContentChatSetTheme) PushMessageContentType() string {
return TypePushMessageContentChatSetTheme
}
// A chat member was deleted
type PushMessageContentChatDeleteMember struct {
meta
// Name of the deleted member
MemberName string `json:"member_name"`
// True, if the current user was deleted from the group
IsCurrentUser bool `json:"is_current_user"`
// True, if the user has left the group themselves
IsLeft bool `json:"is_left"`
}
func (entity *PushMessageContentChatDeleteMember) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentChatDeleteMember
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentChatDeleteMember) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentChatDeleteMember) GetType() string {
return TypePushMessageContentChatDeleteMember
}
func (*PushMessageContentChatDeleteMember) PushMessageContentType() string {
return TypePushMessageContentChatDeleteMember
}
// A new member joined the chat via an invite link
type PushMessageContentChatJoinByLink struct {
meta
}
func (entity *PushMessageContentChatJoinByLink) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentChatJoinByLink
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentChatJoinByLink) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentChatJoinByLink) GetType() string {
return TypePushMessageContentChatJoinByLink
}
func (*PushMessageContentChatJoinByLink) PushMessageContentType() string {
return TypePushMessageContentChatJoinByLink
}
// A new member was accepted to the chat by an administrator
type PushMessageContentChatJoinByRequest struct {
meta
}
func (entity *PushMessageContentChatJoinByRequest) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PushMessageContentChatJoinByRequest
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentChatJoinByRequest) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassPushMessageContent
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentChatJoinByRequest) GetType() string {
return TypePushMessageContentChatJoinByRequest
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentChatJoinByRequest) PushMessageContentType() string {
return TypePushMessageContentChatJoinByRequest
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A new recurrent payment was made by the current user
type PushMessageContentRecurringPayment struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The paid amount
Amount string `json:"amount"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PushMessageContentRecurringPayment) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PushMessageContentRecurringPayment
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentRecurringPayment) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassPushMessageContent
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentRecurringPayment) GetType() string {
return TypePushMessageContentRecurringPayment
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentRecurringPayment) PushMessageContentType() string {
return TypePushMessageContentRecurringPayment
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A profile photo was suggested to the user
type PushMessageContentSuggestProfilePhoto struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *PushMessageContentSuggestProfilePhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PushMessageContentSuggestProfilePhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentSuggestProfilePhoto) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassPushMessageContent
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentSuggestProfilePhoto) GetType() string {
return TypePushMessageContentSuggestProfilePhoto
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentSuggestProfilePhoto) PushMessageContentType() string {
return TypePushMessageContentSuggestProfilePhoto
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A forwarded messages
type PushMessageContentMessageForwards struct {
2021-12-08 10:23:00 +01:00
meta
2023-06-04 22:58:07 +02:00
// Number of forwarded messages
TotalCount int32 `json:"total_count"`
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (entity *PushMessageContentMessageForwards) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
type stub PushMessageContentMessageForwards
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*PushMessageContentMessageForwards) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassPushMessageContent
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentMessageForwards) GetType() string {
return TypePushMessageContentMessageForwards
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentMessageForwards) PushMessageContentType() string {
return TypePushMessageContentMessageForwards
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A media album
type PushMessageContentMediaAlbum struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Number of messages in the album
TotalCount int32 `json:"total_count"`
// True, if the album has at least one photo
HasPhotos bool `json:"has_photos"`
// True, if the album has at least one video file
HasVideos bool `json:"has_videos"`
// True, if the album has at least one audio file
HasAudios bool `json:"has_audios"`
// True, if the album has at least one document
HasDocuments bool `json:"has_documents"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *PushMessageContentMediaAlbum) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub PushMessageContentMediaAlbum
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentMediaAlbum) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassPushMessageContent
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentMediaAlbum) GetType() string {
return TypePushMessageContentMediaAlbum
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*PushMessageContentMediaAlbum) PushMessageContentType() string {
return TypePushMessageContentMediaAlbum
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// New message was received
type NotificationTypeNewMessage struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The message
Message *Message `json:"message"`
// True, if message content must be displayed in notifications
ShowPreview bool `json:"show_preview"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *NotificationTypeNewMessage) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub NotificationTypeNewMessage
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*NotificationTypeNewMessage) GetClass() string {
return ClassNotificationType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationTypeNewMessage) GetType() string {
return TypeNotificationTypeNewMessage
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationTypeNewMessage) NotificationTypeType() string {
return TypeNotificationTypeNewMessage
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// New secret chat was created
type NotificationTypeNewSecretChat struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *NotificationTypeNewSecretChat) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub NotificationTypeNewSecretChat
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*NotificationTypeNewSecretChat) GetClass() string {
return ClassNotificationType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationTypeNewSecretChat) GetType() string {
return TypeNotificationTypeNewSecretChat
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationTypeNewSecretChat) NotificationTypeType() string {
return TypeNotificationTypeNewSecretChat
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// New call was received
type NotificationTypeNewCall struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Call identifier
CallId int32 `json:"call_id"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *NotificationTypeNewCall) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub NotificationTypeNewCall
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*NotificationTypeNewCall) GetClass() string {
return ClassNotificationType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationTypeNewCall) GetType() string {
return TypeNotificationTypeNewCall
}
func (*NotificationTypeNewCall) NotificationTypeType() string {
return TypeNotificationTypeNewCall
}
// New message was received through a push notification
type NotificationTypeNewPushMessage struct {
meta
// The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id
MessageId int64 `json:"message_id"`
// Identifier of the sender of the message. Corresponding user or chat may be inaccessible
SenderId MessageSender `json:"sender_id"`
// Name of the sender
SenderName string `json:"sender_name"`
// True, if the message is outgoing
IsOutgoing bool `json:"is_outgoing"`
// Push message content
Content PushMessageContent `json:"content"`
}
func (entity *NotificationTypeNewPushMessage) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub NotificationTypeNewPushMessage
return json.Marshal((*stub)(entity))
}
func (*NotificationTypeNewPushMessage) GetClass() string {
return ClassNotificationType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationTypeNewPushMessage) GetType() string {
return TypeNotificationTypeNewPushMessage
}
func (*NotificationTypeNewPushMessage) NotificationTypeType() string {
return TypeNotificationTypeNewPushMessage
}
func (notificationTypeNewPushMessage *NotificationTypeNewPushMessage) UnmarshalJSON(data []byte) error {
var tmp struct {
MessageId int64 `json:"message_id"`
SenderId json.RawMessage `json:"sender_id"`
SenderName string `json:"sender_name"`
IsOutgoing bool `json:"is_outgoing"`
Content json.RawMessage `json:"content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
notificationTypeNewPushMessage.MessageId = tmp.MessageId
notificationTypeNewPushMessage.SenderName = tmp.SenderName
notificationTypeNewPushMessage.IsOutgoing = tmp.IsOutgoing
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
notificationTypeNewPushMessage.SenderId = fieldSenderId
fieldContent, _ := UnmarshalPushMessageContent(tmp.Content)
notificationTypeNewPushMessage.Content = fieldContent
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with ordinary unread messages
type NotificationGroupTypeMessages struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *NotificationGroupTypeMessages) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub NotificationGroupTypeMessages
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeMessages) GetClass() string {
return ClassNotificationGroupType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeMessages) GetType() string {
return TypeNotificationGroupTypeMessages
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeMessages) NotificationGroupTypeType() string {
return TypeNotificationGroupTypeMessages
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with unread mentions of the current user, replies to their messages, or a pinned message
type NotificationGroupTypeMentions struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *NotificationGroupTypeMentions) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub NotificationGroupTypeMentions
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeMentions) GetClass() string {
return ClassNotificationGroupType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeMentions) GetType() string {
return TypeNotificationGroupTypeMentions
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeMentions) NotificationGroupTypeType() string {
return TypeNotificationGroupTypeMentions
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// A group containing a notification of type notificationTypeNewSecretChat
type NotificationGroupTypeSecretChat struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *NotificationGroupTypeSecretChat) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub NotificationGroupTypeSecretChat
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeSecretChat) GetClass() string {
return ClassNotificationGroupType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeSecretChat) GetType() string {
return TypeNotificationGroupTypeSecretChat
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeSecretChat) NotificationGroupTypeType() string {
return TypeNotificationGroupTypeSecretChat
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A group containing notifications of type notificationTypeNewCall
type NotificationGroupTypeCalls struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *NotificationGroupTypeCalls) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub NotificationGroupTypeCalls
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeCalls) GetClass() string {
return ClassNotificationGroupType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeCalls) GetType() string {
return TypeNotificationGroupTypeCalls
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroupTypeCalls) NotificationGroupTypeType() string {
return TypeNotificationGroupTypeCalls
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Describes a notification sound in MP3 format
type NotificationSound struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Unique identifier of the notification sound
Id JsonInt64 `json:"id"`
// Duration of the sound, in seconds
Duration int32 `json:"duration"`
// Point in time (Unix timestamp) when the sound was created
Date int32 `json:"date"`
// Title of the notification sound
Title string `json:"title"`
// Arbitrary data, defined while the sound was uploaded
Data string `json:"data"`
// File containing the sound
Sound *File `json:"sound"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *NotificationSound) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub NotificationSound
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*NotificationSound) GetClass() string {
return ClassNotificationSound
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationSound) GetType() string {
return TypeNotificationSound
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains a list of notification sounds
type NotificationSounds struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// A list of notification sounds
NotificationSounds []*NotificationSound `json:"notification_sounds"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *NotificationSounds) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub NotificationSounds
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*NotificationSounds) GetClass() string {
return ClassNotificationSounds
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationSounds) GetType() string {
return TypeNotificationSounds
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains information about a notification
type Notification struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Unique persistent identifier of this notification
Id int32 `json:"id"`
// Notification date
Date int32 `json:"date"`
// True, if the notification was explicitly sent without sound
IsSilent bool `json:"is_silent"`
// Notification type
Type NotificationType `json:"type"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *Notification) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub Notification
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*Notification) GetClass() string {
return ClassNotification
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*Notification) GetType() string {
return TypeNotification
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (notification *Notification) UnmarshalJSON(data []byte) error {
var tmp struct {
Id int32 `json:"id"`
Date int32 `json:"date"`
IsSilent bool `json:"is_silent"`
Type json.RawMessage `json:"type"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
notification.Id = tmp.Id
notification.Date = tmp.Date
notification.IsSilent = tmp.IsSilent
fieldType, _ := UnmarshalNotificationType(tmp.Type)
notification.Type = fieldType
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Describes a group of notifications
type NotificationGroup struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Unique persistent auto-incremented from 1 identifier of the notification group
Id int32 `json:"id"`
// Type of the group
Type NotificationGroupType `json:"type"`
// Identifier of a chat to which all notifications in the group belong
ChatId int64 `json:"chat_id"`
// Total number of active notifications in the group
TotalCount int32 `json:"total_count"`
// The list of active notifications
Notifications []*Notification `json:"notifications"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *NotificationGroup) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub NotificationGroup
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroup) GetClass() string {
return ClassNotificationGroup
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*NotificationGroup) GetType() string {
return TypeNotificationGroup
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (notificationGroup *NotificationGroup) UnmarshalJSON(data []byte) error {
var tmp struct {
Id int32 `json:"id"`
Type json.RawMessage `json:"type"`
ChatId int64 `json:"chat_id"`
TotalCount int32 `json:"total_count"`
Notifications []*Notification `json:"notifications"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
notificationGroup.Id = tmp.Id
notificationGroup.ChatId = tmp.ChatId
notificationGroup.TotalCount = tmp.TotalCount
notificationGroup.Notifications = tmp.Notifications
fieldType, _ := UnmarshalNotificationGroupType(tmp.Type)
notificationGroup.Type = fieldType
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents a boolean option
type OptionValueBoolean struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The value of the option
Value bool `json:"value"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *OptionValueBoolean) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub OptionValueBoolean
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*OptionValueBoolean) GetClass() string {
return ClassOptionValue
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*OptionValueBoolean) GetType() string {
return TypeOptionValueBoolean
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*OptionValueBoolean) OptionValueType() string {
return TypeOptionValueBoolean
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents an unknown option or an option which has a default value
type OptionValueEmpty struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *OptionValueEmpty) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub OptionValueEmpty
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*OptionValueEmpty) GetClass() string {
return ClassOptionValue
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*OptionValueEmpty) GetType() string {
return TypeOptionValueEmpty
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*OptionValueEmpty) OptionValueType() string {
return TypeOptionValueEmpty
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents an integer option
type OptionValueInteger struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The value of the option
Value JsonInt64 `json:"value"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *OptionValueInteger) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub OptionValueInteger
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*OptionValueInteger) GetClass() string {
return ClassOptionValue
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*OptionValueInteger) GetType() string {
return TypeOptionValueInteger
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*OptionValueInteger) OptionValueType() string {
return TypeOptionValueInteger
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents a string option
type OptionValueString struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The value of the option
Value string `json:"value"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *OptionValueString) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub OptionValueString
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*OptionValueString) GetClass() string {
return ClassOptionValue
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*OptionValueString) GetType() string {
return TypeOptionValueString
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*OptionValueString) OptionValueType() string {
return TypeOptionValueString
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents one member of a JSON object
type JsonObjectMember struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Member's key
Key string `json:"key"`
// Member's value
Value JsonValue `json:"value"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *JsonObjectMember) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub JsonObjectMember
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*JsonObjectMember) GetClass() string {
return ClassJsonObjectMember
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonObjectMember) GetType() string {
return TypeJsonObjectMember
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (jsonObjectMember *JsonObjectMember) UnmarshalJSON(data []byte) error {
var tmp struct {
Key string `json:"key"`
Value json.RawMessage `json:"value"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
jsonObjectMember.Key = tmp.Key
fieldValue, _ := UnmarshalJsonValue(tmp.Value)
jsonObjectMember.Value = fieldValue
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents a null JSON value
type JsonValueNull struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *JsonValueNull) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub JsonValueNull
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*JsonValueNull) GetClass() string {
return ClassJsonValue
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonValueNull) GetType() string {
return TypeJsonValueNull
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonValueNull) JsonValueType() string {
return TypeJsonValueNull
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents a boolean JSON value
type JsonValueBoolean struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The value
Value bool `json:"value"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *JsonValueBoolean) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub JsonValueBoolean
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*JsonValueBoolean) GetClass() string {
return ClassJsonValue
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonValueBoolean) GetType() string {
return TypeJsonValueBoolean
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonValueBoolean) JsonValueType() string {
return TypeJsonValueBoolean
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents a numeric JSON value
type JsonValueNumber struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The value
Value float64 `json:"value"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *JsonValueNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub JsonValueNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*JsonValueNumber) GetClass() string {
return ClassJsonValue
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonValueNumber) GetType() string {
return TypeJsonValueNumber
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonValueNumber) JsonValueType() string {
return TypeJsonValueNumber
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents a string JSON value
type JsonValueString struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The value
Value string `json:"value"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *JsonValueString) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub JsonValueString
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*JsonValueString) GetClass() string {
return ClassJsonValue
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonValueString) GetType() string {
return TypeJsonValueString
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonValueString) JsonValueType() string {
return TypeJsonValueString
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents a JSON array
type JsonValueArray struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The list of array elements
Values []JsonValue `json:"values"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *JsonValueArray) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub JsonValueArray
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*JsonValueArray) GetClass() string {
return ClassJsonValue
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonValueArray) GetType() string {
return TypeJsonValueArray
}
func (*JsonValueArray) JsonValueType() string {
return TypeJsonValueArray
}
func (jsonValueArray *JsonValueArray) UnmarshalJSON(data []byte) error {
var tmp struct {
Values []json.RawMessage `json:"values"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldValues, _ := UnmarshalListOfJsonValue(tmp.Values)
jsonValueArray.Values = fieldValues
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Represents a JSON object
type JsonValueObject struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The list of object members
Members []*JsonObjectMember `json:"members"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *JsonValueObject) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub JsonValueObject
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*JsonValueObject) GetClass() string {
return ClassJsonValue
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonValueObject) GetType() string {
return TypeJsonValueObject
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*JsonValueObject) JsonValueType() string {
return TypeJsonValueObject
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A rule to allow all users to do something
type UserPrivacySettingRuleAllowAll struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingRuleAllowAll) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingRuleAllowAll
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowAll) GetClass() string {
return ClassUserPrivacySettingRule
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowAll) GetType() string {
return TypeUserPrivacySettingRuleAllowAll
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowAll) UserPrivacySettingRuleType() string {
return TypeUserPrivacySettingRuleAllowAll
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A rule to allow all of a user's contacts to do something
type UserPrivacySettingRuleAllowContacts struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingRuleAllowContacts) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingRuleAllowContacts
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowContacts) GetClass() string {
return ClassUserPrivacySettingRule
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowContacts) GetType() string {
return TypeUserPrivacySettingRuleAllowContacts
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowContacts) UserPrivacySettingRuleType() string {
return TypeUserPrivacySettingRuleAllowContacts
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// A rule to allow certain specified users to do something
type UserPrivacySettingRuleAllowUsers struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The user identifiers, total number of users in all rules must not exceed 1000
UserIds []int64 `json:"user_ids"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingRuleAllowUsers) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingRuleAllowUsers
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowUsers) GetClass() string {
return ClassUserPrivacySettingRule
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowUsers) GetType() string {
return TypeUserPrivacySettingRuleAllowUsers
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowUsers) UserPrivacySettingRuleType() string {
return TypeUserPrivacySettingRuleAllowUsers
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A rule to allow all members of certain specified basic groups and supergroups to doing something
type UserPrivacySettingRuleAllowChatMembers struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The chat identifiers, total number of chats in all rules must not exceed 20
ChatIds []int64 `json:"chat_ids"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingRuleAllowChatMembers) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingRuleAllowChatMembers
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowChatMembers) GetClass() string {
return ClassUserPrivacySettingRule
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowChatMembers) GetType() string {
return TypeUserPrivacySettingRuleAllowChatMembers
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleAllowChatMembers) UserPrivacySettingRuleType() string {
return TypeUserPrivacySettingRuleAllowChatMembers
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A rule to restrict all users from doing something
type UserPrivacySettingRuleRestrictAll struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingRuleRestrictAll) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingRuleRestrictAll
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictAll) GetClass() string {
return ClassUserPrivacySettingRule
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictAll) GetType() string {
return TypeUserPrivacySettingRuleRestrictAll
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictAll) UserPrivacySettingRuleType() string {
return TypeUserPrivacySettingRuleRestrictAll
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A rule to restrict all contacts of a user from doing something
type UserPrivacySettingRuleRestrictContacts struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingRuleRestrictContacts) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingRuleRestrictContacts
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictContacts) GetClass() string {
return ClassUserPrivacySettingRule
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictContacts) GetType() string {
return TypeUserPrivacySettingRuleRestrictContacts
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictContacts) UserPrivacySettingRuleType() string {
return TypeUserPrivacySettingRuleRestrictContacts
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A rule to restrict all specified users from doing something
type UserPrivacySettingRuleRestrictUsers struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// The user identifiers, total number of users in all rules must not exceed 1000
UserIds []int64 `json:"user_ids"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingRuleRestrictUsers) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingRuleRestrictUsers
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictUsers) GetClass() string {
return ClassUserPrivacySettingRule
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictUsers) GetType() string {
return TypeUserPrivacySettingRuleRestrictUsers
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictUsers) UserPrivacySettingRuleType() string {
return TypeUserPrivacySettingRuleRestrictUsers
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A rule to restrict all members of specified basic groups and supergroups from doing something
type UserPrivacySettingRuleRestrictChatMembers struct {
meta
// The chat identifiers, total number of chats in all rules must not exceed 20
ChatIds []int64 `json:"chat_ids"`
}
func (entity *UserPrivacySettingRuleRestrictChatMembers) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingRuleRestrictChatMembers
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictChatMembers) GetClass() string {
return ClassUserPrivacySettingRule
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictChatMembers) GetType() string {
return TypeUserPrivacySettingRuleRestrictChatMembers
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRuleRestrictChatMembers) UserPrivacySettingRuleType() string {
return TypeUserPrivacySettingRuleRestrictChatMembers
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed
type UserPrivacySettingRules struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// A list of rules
Rules []UserPrivacySettingRule `json:"rules"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingRules) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingRules
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRules) GetClass() string {
return ClassUserPrivacySettingRules
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingRules) GetType() string {
return TypeUserPrivacySettingRules
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (userPrivacySettingRules *UserPrivacySettingRules) UnmarshalJSON(data []byte) error {
var tmp struct {
Rules []json.RawMessage `json:"rules"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldRules, _ := UnmarshalListOfUserPrivacySettingRule(tmp.Rules)
userPrivacySettingRules.Rules = fieldRules
return nil
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A privacy setting for managing whether the user's online status is visible
type UserPrivacySettingShowStatus struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingShowStatus) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingShowStatus
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowStatus) GetClass() string {
return ClassUserPrivacySetting
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowStatus) GetType() string {
return TypeUserPrivacySettingShowStatus
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowStatus) UserPrivacySettingType() string {
return TypeUserPrivacySettingShowStatus
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A privacy setting for managing whether the user's profile photo is visible
type UserPrivacySettingShowProfilePhoto struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingShowProfilePhoto) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingShowProfilePhoto
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowProfilePhoto) GetClass() string {
return ClassUserPrivacySetting
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowProfilePhoto) GetType() string {
return TypeUserPrivacySettingShowProfilePhoto
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowProfilePhoto) UserPrivacySettingType() string {
return TypeUserPrivacySettingShowProfilePhoto
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A privacy setting for managing whether a link to the user's account is included in forwarded messages
type UserPrivacySettingShowLinkInForwardedMessages struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingShowLinkInForwardedMessages) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingShowLinkInForwardedMessages
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowLinkInForwardedMessages) GetClass() string {
return ClassUserPrivacySetting
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowLinkInForwardedMessages) GetType() string {
return TypeUserPrivacySettingShowLinkInForwardedMessages
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowLinkInForwardedMessages) UserPrivacySettingType() string {
return TypeUserPrivacySettingShowLinkInForwardedMessages
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A privacy setting for managing whether the user's phone number is visible
type UserPrivacySettingShowPhoneNumber struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingShowPhoneNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingShowPhoneNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowPhoneNumber) GetClass() string {
return ClassUserPrivacySetting
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowPhoneNumber) GetType() string {
return TypeUserPrivacySettingShowPhoneNumber
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingShowPhoneNumber) UserPrivacySettingType() string {
return TypeUserPrivacySettingShowPhoneNumber
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A privacy setting for managing whether the user can be invited to chats
type UserPrivacySettingAllowChatInvites struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingAllowChatInvites) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingAllowChatInvites
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowChatInvites) GetClass() string {
return ClassUserPrivacySetting
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowChatInvites) GetType() string {
return TypeUserPrivacySettingAllowChatInvites
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowChatInvites) UserPrivacySettingType() string {
return TypeUserPrivacySettingAllowChatInvites
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A privacy setting for managing whether the user can be called
type UserPrivacySettingAllowCalls struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingAllowCalls) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingAllowCalls
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowCalls) GetClass() string {
return ClassUserPrivacySetting
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowCalls) GetType() string {
return TypeUserPrivacySettingAllowCalls
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowCalls) UserPrivacySettingType() string {
return TypeUserPrivacySettingAllowCalls
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A privacy setting for managing whether peer-to-peer connections can be used for calls
type UserPrivacySettingAllowPeerToPeerCalls struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingAllowPeerToPeerCalls) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingAllowPeerToPeerCalls
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowPeerToPeerCalls) GetClass() string {
return ClassUserPrivacySetting
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowPeerToPeerCalls) GetType() string {
return TypeUserPrivacySettingAllowPeerToPeerCalls
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowPeerToPeerCalls) UserPrivacySettingType() string {
return TypeUserPrivacySettingAllowPeerToPeerCalls
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all"
type UserPrivacySettingAllowFindingByPhoneNumber struct {
meta
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingAllowFindingByPhoneNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingAllowFindingByPhoneNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowFindingByPhoneNumber) GetClass() string {
return ClassUserPrivacySetting
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowFindingByPhoneNumber) GetType() string {
return TypeUserPrivacySettingAllowFindingByPhoneNumber
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowFindingByPhoneNumber) UserPrivacySettingType() string {
return TypeUserPrivacySettingAllowFindingByPhoneNumber
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// A privacy setting for managing whether the user can receive voice and video messages in private chats
type UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) GetClass() string {
return ClassUserPrivacySetting
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) GetType() string {
return TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) UserPrivacySettingType() string {
return TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// Contains information about the period of inactivity after which the current user's account will automatically be deleted
type AccountTtl struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Number of days of inactivity before the account will be flagged for deletion; 30-366 days
Days int32 `json:"days"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *AccountTtl) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub AccountTtl
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*AccountTtl) GetClass() string {
return ClassAccountTtl
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*AccountTtl) GetType() string {
return TypeAccountTtl
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains default auto-delete timer setting for new chats
type MessageAutoDeleteTime struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Message auto-delete time, in seconds. If 0, then messages aren't deleted automatically
Time int32 `json:"time"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *MessageAutoDeleteTime) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub MessageAutoDeleteTime
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*MessageAutoDeleteTime) GetClass() string {
return ClassMessageAutoDeleteTime
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*MessageAutoDeleteTime) GetType() string {
return TypeMessageAutoDeleteTime
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on an Android device
type SessionTypeAndroid struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeAndroid) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeAndroid
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeAndroid) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeAndroid) GetType() string {
return TypeSessionTypeAndroid
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeAndroid) SessionTypeType() string {
return TypeSessionTypeAndroid
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on a generic Apple device
type SessionTypeApple struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeApple) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeApple
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*SessionTypeApple) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeApple) GetType() string {
return TypeSessionTypeApple
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeApple) SessionTypeType() string {
return TypeSessionTypeApple
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on the Brave browser
type SessionTypeBrave struct {
2021-12-08 10:23:00 +01:00
meta
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeBrave) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
type stub SessionTypeBrave
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*SessionTypeBrave) GetClass() string {
return ClassSessionType
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*SessionTypeBrave) GetType() string {
return TypeSessionTypeBrave
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*SessionTypeBrave) SessionTypeType() string {
return TypeSessionTypeBrave
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on the Chrome browser
type SessionTypeChrome struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeChrome) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeChrome
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeChrome) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeChrome) GetType() string {
return TypeSessionTypeChrome
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeChrome) SessionTypeType() string {
return TypeSessionTypeChrome
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on the Edge browser
type SessionTypeEdge struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeEdge) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeEdge
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeEdge) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeEdge) GetType() string {
return TypeSessionTypeEdge
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeEdge) SessionTypeType() string {
return TypeSessionTypeEdge
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on the Firefox browser
type SessionTypeFirefox struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeFirefox) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeFirefox
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeFirefox) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeFirefox) GetType() string {
return TypeSessionTypeFirefox
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeFirefox) SessionTypeType() string {
return TypeSessionTypeFirefox
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on an iPad device
type SessionTypeIpad struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeIpad) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeIpad
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeIpad) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeIpad) GetType() string {
return TypeSessionTypeIpad
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeIpad) SessionTypeType() string {
return TypeSessionTypeIpad
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on an iPhone device
type SessionTypeIphone struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeIphone) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeIphone
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeIphone) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeIphone) GetType() string {
return TypeSessionTypeIphone
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeIphone) SessionTypeType() string {
return TypeSessionTypeIphone
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on a Linux device
type SessionTypeLinux struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeLinux) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeLinux
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeLinux) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeLinux) GetType() string {
return TypeSessionTypeLinux
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeLinux) SessionTypeType() string {
return TypeSessionTypeLinux
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
// The session is running on a Mac device
type SessionTypeMac struct {
2021-12-08 10:23:00 +01:00
meta
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeMac) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeMac
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeMac) GetClass() string {
return ClassSessionType
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeMac) GetType() string {
return TypeSessionTypeMac
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeMac) SessionTypeType() string {
return TypeSessionTypeMac
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
// The session is running on the Opera browser
type SessionTypeOpera struct {
2021-12-08 10:23:00 +01:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeOpera) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeOpera
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeOpera) GetClass() string {
return ClassSessionType
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*SessionTypeOpera) GetType() string {
return TypeSessionTypeOpera
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (*SessionTypeOpera) SessionTypeType() string {
return TypeSessionTypeOpera
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on the Safari browser
type SessionTypeSafari struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeSafari) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeSafari
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeSafari) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeSafari) GetType() string {
return TypeSessionTypeSafari
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeSafari) SessionTypeType() string {
return TypeSessionTypeSafari
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on an Ubuntu device
type SessionTypeUbuntu struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeUbuntu) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeUbuntu
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeUbuntu) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeUbuntu) GetType() string {
return TypeSessionTypeUbuntu
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeUbuntu) SessionTypeType() string {
return TypeSessionTypeUbuntu
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on an unknown type of device
type SessionTypeUnknown struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeUnknown) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeUnknown
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeUnknown) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeUnknown) GetType() string {
return TypeSessionTypeUnknown
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeUnknown) SessionTypeType() string {
return TypeSessionTypeUnknown
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on the Vivaldi browser
type SessionTypeVivaldi struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeVivaldi) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeVivaldi
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeVivaldi) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeVivaldi) GetType() string {
return TypeSessionTypeVivaldi
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeVivaldi) SessionTypeType() string {
return TypeSessionTypeVivaldi
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The session is running on a Windows device
type SessionTypeWindows struct {
2021-10-22 16:24:12 +02:00
meta
}
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeWindows) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub SessionTypeWindows
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeWindows) GetClass() string {
return ClassSessionType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeWindows) GetType() string {
return TypeSessionTypeWindows
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeWindows) SessionTypeType() string {
return TypeSessionTypeWindows
2021-12-08 10:23:00 +01:00
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
// The session is running on an Xbox console
type SessionTypeXbox struct {
2021-12-08 10:23:00 +01:00
meta
}
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
func (entity *SessionTypeXbox) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2021-10-22 16:24:12 +02:00
2023-06-04 22:58:07 +02:00
type stub SessionTypeXbox
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeXbox) GetClass() string {
return ClassSessionType
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*SessionTypeXbox) GetType() string {
return TypeSessionTypeXbox
}
func (*SessionTypeXbox) SessionTypeType() string {
return TypeSessionTypeXbox
2021-12-08 10:23:00 +01:00
}
// Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order
type Session struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Session identifier
Id JsonInt64 `json:"id"`
// True, if this session is the current session
IsCurrent bool `json:"is_current"`
2023-06-04 22:58:07 +02:00
// True, if a 2-step verification password is needed to complete authorization of the session
2021-12-08 10:23:00 +01:00
IsPasswordPending bool `json:"is_password_pending"`
// True, if incoming secret chats can be accepted by the session
CanAcceptSecretChats bool `json:"can_accept_secret_chats"`
// True, if incoming calls can be accepted by the session
CanAcceptCalls bool `json:"can_accept_calls"`
2023-06-04 22:58:07 +02:00
// Session type based on the system and application version, which can be used to display a corresponding icon
Type SessionType `json:"type"`
2021-12-08 10:23:00 +01:00
// Telegram API identifier, as provided by the application
ApiId int32 `json:"api_id"`
// Name of the application, as provided by the application
ApplicationName string `json:"application_name"`
// The version of the application, as provided by the application
ApplicationVersion string `json:"application_version"`
// True, if the application is an official application or uses the api_id of an official application
IsOfficialApplication bool `json:"is_official_application"`
// Model of the device the application has been run or is running on, as provided by the application
DeviceModel string `json:"device_model"`
// Operating system the application has been run or is running on, as provided by the application
Platform string `json:"platform"`
// Version of the operating system the application has been run or is running on, as provided by the application
SystemVersion string `json:"system_version"`
// Point in time (Unix timestamp) when the user has logged in
LogInDate int32 `json:"log_in_date"`
// Point in time (Unix timestamp) when the session was last used
LastActiveDate int32 `json:"last_active_date"`
// IP address from which the session was created, in human-readable format
Ip string `json:"ip"`
// A two-letter country code for the country from which the session was created, based on the IP address
Country string `json:"country"`
// Region code from which the session was created, based on the IP address
Region string `json:"region"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Session) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Session
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Session) GetClass() string {
return ClassSession
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Session) GetType() string {
return TypeSession
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (session *Session) UnmarshalJSON(data []byte) error {
var tmp struct {
Id JsonInt64 `json:"id"`
IsCurrent bool `json:"is_current"`
IsPasswordPending bool `json:"is_password_pending"`
CanAcceptSecretChats bool `json:"can_accept_secret_chats"`
CanAcceptCalls bool `json:"can_accept_calls"`
Type json.RawMessage `json:"type"`
ApiId int32 `json:"api_id"`
ApplicationName string `json:"application_name"`
ApplicationVersion string `json:"application_version"`
IsOfficialApplication bool `json:"is_official_application"`
DeviceModel string `json:"device_model"`
Platform string `json:"platform"`
SystemVersion string `json:"system_version"`
LogInDate int32 `json:"log_in_date"`
LastActiveDate int32 `json:"last_active_date"`
Ip string `json:"ip"`
Country string `json:"country"`
Region string `json:"region"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
session.Id = tmp.Id
session.IsCurrent = tmp.IsCurrent
session.IsPasswordPending = tmp.IsPasswordPending
session.CanAcceptSecretChats = tmp.CanAcceptSecretChats
session.CanAcceptCalls = tmp.CanAcceptCalls
session.ApiId = tmp.ApiId
session.ApplicationName = tmp.ApplicationName
session.ApplicationVersion = tmp.ApplicationVersion
session.IsOfficialApplication = tmp.IsOfficialApplication
session.DeviceModel = tmp.DeviceModel
session.Platform = tmp.Platform
session.SystemVersion = tmp.SystemVersion
session.LogInDate = tmp.LogInDate
session.LastActiveDate = tmp.LastActiveDate
session.Ip = tmp.Ip
session.Country = tmp.Country
session.Region = tmp.Region
fieldType, _ := UnmarshalSessionType(tmp.Type)
session.Type = fieldType
return nil
}
2021-12-08 10:23:00 +01:00
// Contains a list of sessions
type Sessions struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of sessions
Sessions []*Session `json:"sessions"`
// Number of days of inactivity before sessions will automatically be terminated; 1-366 days
InactiveSessionTtlDays int32 `json:"inactive_session_ttl_days"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *Sessions) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub Sessions
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*Sessions) GetClass() string {
return ClassSessions
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*Sessions) GetType() string {
return TypeSessions
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// Contains information about one website the current user is logged in with Telegram
type ConnectedWebsite struct {
meta
// Website identifier
Id JsonInt64 `json:"id"`
// The domain name of the website
DomainName string `json:"domain_name"`
// User identifier of a bot linked with the website
BotUserId int64 `json:"bot_user_id"`
// The version of a browser used to log in
Browser string `json:"browser"`
// Operating system the browser is running on
Platform string `json:"platform"`
// Point in time (Unix timestamp) when the user was logged in
LogInDate int32 `json:"log_in_date"`
// Point in time (Unix timestamp) when obtained authorization was last used
LastActiveDate int32 `json:"last_active_date"`
// IP address from which the user was logged in, in human-readable format
Ip string `json:"ip"`
2023-06-04 22:58:07 +02:00
// Human-readable description of a country and a region from which the user was logged in, based on the IP address
2021-12-08 10:23:00 +01:00
Location string `json:"location"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ConnectedWebsite) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ConnectedWebsite
return json.Marshal((*stub)(entity))
}
func (*ConnectedWebsite) GetClass() string {
return ClassConnectedWebsite
}
func (*ConnectedWebsite) GetType() string {
return TypeConnectedWebsite
}
// Contains a list of websites the current user is logged in with Telegram
type ConnectedWebsites struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// List of connected websites
Websites []*ConnectedWebsite `json:"websites"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *ConnectedWebsites) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ConnectedWebsites
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ConnectedWebsites) GetClass() string {
return ClassConnectedWebsites
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ConnectedWebsites) GetType() string {
return TypeConnectedWebsites
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat contains spam messages
type ChatReportReasonSpam struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatReportReasonSpam) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatReportReasonSpam
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonSpam) GetClass() string {
return ClassChatReportReason
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonSpam) GetType() string {
return TypeChatReportReasonSpam
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonSpam) ChatReportReasonType() string {
return TypeChatReportReasonSpam
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat promotes violence
type ChatReportReasonViolence struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatReportReasonViolence) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatReportReasonViolence
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonViolence) GetClass() string {
return ClassChatReportReason
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonViolence) GetType() string {
return TypeChatReportReasonViolence
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonViolence) ChatReportReasonType() string {
return TypeChatReportReasonViolence
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat contains pornographic messages
type ChatReportReasonPornography struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatReportReasonPornography) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatReportReasonPornography
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonPornography) GetClass() string {
return ClassChatReportReason
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonPornography) GetType() string {
return TypeChatReportReasonPornography
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonPornography) ChatReportReasonType() string {
return TypeChatReportReasonPornography
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat has child abuse related content
type ChatReportReasonChildAbuse struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatReportReasonChildAbuse) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatReportReasonChildAbuse
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonChildAbuse) GetClass() string {
return ClassChatReportReason
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonChildAbuse) GetType() string {
return TypeChatReportReasonChildAbuse
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonChildAbuse) ChatReportReasonType() string {
return TypeChatReportReasonChildAbuse
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat contains copyrighted content
type ChatReportReasonCopyright struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatReportReasonCopyright) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatReportReasonCopyright
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonCopyright) GetClass() string {
return ClassChatReportReason
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonCopyright) GetType() string {
return TypeChatReportReasonCopyright
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonCopyright) ChatReportReasonType() string {
return TypeChatReportReasonCopyright
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The location-based chat is unrelated to its stated location
type ChatReportReasonUnrelatedLocation struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatReportReasonUnrelatedLocation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatReportReasonUnrelatedLocation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonUnrelatedLocation) GetClass() string {
return ClassChatReportReason
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonUnrelatedLocation) GetType() string {
return TypeChatReportReasonUnrelatedLocation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonUnrelatedLocation) ChatReportReasonType() string {
return TypeChatReportReasonUnrelatedLocation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The chat represents a fake account
type ChatReportReasonFake struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatReportReasonFake) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatReportReasonFake
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonFake) GetClass() string {
return ClassChatReportReason
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonFake) GetType() string {
return TypeChatReportReasonFake
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonFake) ChatReportReasonType() string {
return TypeChatReportReasonFake
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The chat has illegal drugs related content
type ChatReportReasonIllegalDrugs struct {
meta
}
func (entity *ChatReportReasonIllegalDrugs) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatReportReasonIllegalDrugs
return json.Marshal((*stub)(entity))
}
func (*ChatReportReasonIllegalDrugs) GetClass() string {
return ClassChatReportReason
}
func (*ChatReportReasonIllegalDrugs) GetType() string {
return TypeChatReportReasonIllegalDrugs
}
func (*ChatReportReasonIllegalDrugs) ChatReportReasonType() string {
return TypeChatReportReasonIllegalDrugs
}
// The chat contains messages with personal details
type ChatReportReasonPersonalDetails struct {
meta
}
func (entity *ChatReportReasonPersonalDetails) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatReportReasonPersonalDetails
return json.Marshal((*stub)(entity))
}
func (*ChatReportReasonPersonalDetails) GetClass() string {
return ClassChatReportReason
}
func (*ChatReportReasonPersonalDetails) GetType() string {
return TypeChatReportReasonPersonalDetails
}
func (*ChatReportReasonPersonalDetails) ChatReportReasonType() string {
return TypeChatReportReasonPersonalDetails
}
2021-12-08 10:23:00 +01:00
// A custom reason provided by the user
type ChatReportReasonCustom struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *ChatReportReasonCustom) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub ChatReportReasonCustom
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonCustom) GetClass() string {
return ClassChatReportReason
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonCustom) GetType() string {
return TypeChatReportReasonCustom
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*ChatReportReasonCustom) ChatReportReasonType() string {
return TypeChatReportReasonCustom
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The currently opened chat needs to be kept
type TargetChatCurrent struct {
meta
}
func (entity *TargetChatCurrent) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TargetChatCurrent
return json.Marshal((*stub)(entity))
}
func (*TargetChatCurrent) GetClass() string {
return ClassTargetChat
}
func (*TargetChatCurrent) GetType() string {
return TypeTargetChatCurrent
}
func (*TargetChatCurrent) TargetChatType() string {
return TypeTargetChatCurrent
}
// The chat needs to be chosen by the user among chats of the specified types
type TargetChatChosen struct {
meta
// True, if private chats with ordinary users are allowed
AllowUserChats bool `json:"allow_user_chats"`
// True, if private chats with other bots are allowed
AllowBotChats bool `json:"allow_bot_chats"`
// True, if basic group and supergroup chats are allowed
AllowGroupChats bool `json:"allow_group_chats"`
// True, if channel chats are allowed
AllowChannelChats bool `json:"allow_channel_chats"`
}
func (entity *TargetChatChosen) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TargetChatChosen
return json.Marshal((*stub)(entity))
}
func (*TargetChatChosen) GetClass() string {
return ClassTargetChat
}
func (*TargetChatChosen) GetType() string {
return TypeTargetChatChosen
}
func (*TargetChatChosen) TargetChatType() string {
return TypeTargetChatChosen
}
// The chat needs to be open with the provided internal link
type TargetChatInternalLink struct {
meta
// An internal link pointing to the chat
Link InternalLinkType `json:"link"`
}
func (entity *TargetChatInternalLink) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TargetChatInternalLink
return json.Marshal((*stub)(entity))
}
func (*TargetChatInternalLink) GetClass() string {
return ClassTargetChat
}
func (*TargetChatInternalLink) GetType() string {
return TypeTargetChatInternalLink
}
func (*TargetChatInternalLink) TargetChatType() string {
return TypeTargetChatInternalLink
}
func (targetChatInternalLink *TargetChatInternalLink) UnmarshalJSON(data []byte) error {
var tmp struct {
Link json.RawMessage `json:"link"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldLink, _ := UnmarshalInternalLinkType(tmp.Link)
targetChatInternalLink.Link = fieldLink
return nil
}
// The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link
2021-12-08 10:23:00 +01:00
type InternalLinkTypeActiveSessions struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeActiveSessions) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeActiveSessions
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeActiveSessions) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeActiveSessions) GetType() string {
return TypeInternalLinkTypeActiveSessions
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string {
return TypeInternalLinkTypeActiveSessions
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then user needs to confirm adding the bot to attachment menu. If user confirms adding, then use toggleBotIsAddedToAttachmentMenu to add it. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL
type InternalLinkTypeAttachmentMenuBot struct {
meta
// Target chat to be opened
TargetChat TargetChat `json:"target_chat"`
// Username of the bot
BotUsername string `json:"bot_username"`
// URL to be passed to openWebApp
Url string `json:"url"`
}
func (entity *InternalLinkTypeAttachmentMenuBot) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeAttachmentMenuBot
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeAttachmentMenuBot) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeAttachmentMenuBot) GetType() string {
return TypeInternalLinkTypeAttachmentMenuBot
}
func (*InternalLinkTypeAttachmentMenuBot) InternalLinkTypeType() string {
return TypeInternalLinkTypeAttachmentMenuBot
}
func (internalLinkTypeAttachmentMenuBot *InternalLinkTypeAttachmentMenuBot) UnmarshalJSON(data []byte) error {
var tmp struct {
TargetChat json.RawMessage `json:"target_chat"`
BotUsername string `json:"bot_username"`
Url string `json:"url"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
internalLinkTypeAttachmentMenuBot.BotUsername = tmp.BotUsername
internalLinkTypeAttachmentMenuBot.Url = tmp.Url
fieldTargetChat, _ := UnmarshalTargetChat(tmp.TargetChat)
internalLinkTypeAttachmentMenuBot.TargetChat = fieldTargetChat
return nil
}
2021-12-08 10:23:00 +01:00
// The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode
type InternalLinkTypeAuthenticationCode struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// The authentication code
Code string `json:"code"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeAuthenticationCode) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeAuthenticationCode
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeAuthenticationCode) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeAuthenticationCode) GetType() string {
return TypeInternalLinkTypeAuthenticationCode
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeAuthenticationCode) InternalLinkTypeType() string {
return TypeInternalLinkTypeAuthenticationCode
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The link is a link to a background. Call searchBackground with the given background name to process the link
type InternalLinkTypeBackground struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Name of the background
BackgroundName string `json:"background_name"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeBackground) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeBackground
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeBackground) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeBackground) GetType() string {
return TypeInternalLinkTypeBackground
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeBackground) InternalLinkTypeType() string {
return TypeInternalLinkTypeBackground
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, and then call sendBotStartMessage with the given start parameter after the button is pressed
type InternalLinkTypeBotStart struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Username of the bot
BotUsername string `json:"bot_username"`
// The parameter to be passed to sendBotStartMessage
StartParameter string `json:"start_parameter"`
2023-06-04 22:58:07 +02:00
// True, if sendBotStartMessage must be called automatically without showing the START button
Autostart bool `json:"autostart"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeBotStart) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeBotStart
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeBotStart) GetClass() string {
return ClassInternalLinkType
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeBotStart) GetType() string {
return TypeInternalLinkTypeBotStart
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeBotStart) InternalLinkTypeType() string {
return TypeInternalLinkTypeBotStart
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat, otherwise just send /start message with bot's username added to the chat.
2021-12-08 10:23:00 +01:00
type InternalLinkTypeBotStartInGroup struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Username of the bot
BotUsername string `json:"bot_username"`
// The parameter to be passed to sendBotStartMessage
StartParameter string `json:"start_parameter"`
2023-06-04 22:58:07 +02:00
// Expected administrator rights for the bot; may be null
AdministratorRights *ChatAdministratorRights `json:"administrator_rights"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeBotStartInGroup) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeBotStartInGroup
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeBotStartInGroup) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeBotStartInGroup) GetType() string {
return TypeInternalLinkTypeBotStartInGroup
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeBotStartInGroup) InternalLinkTypeType() string {
return TypeInternalLinkTypeBotStartInGroup
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights
type InternalLinkTypeBotAddToChannel struct {
meta
// Username of the bot
BotUsername string `json:"bot_username"`
// Expected administrator rights for the bot
AdministratorRights *ChatAdministratorRights `json:"administrator_rights"`
}
func (entity *InternalLinkTypeBotAddToChannel) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeBotAddToChannel
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeBotAddToChannel) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeBotAddToChannel) GetType() string {
return TypeInternalLinkTypeBotAddToChannel
}
func (*InternalLinkTypeBotAddToChannel) InternalLinkTypeType() string {
return TypeInternalLinkTypeBotAddToChannel
}
2021-12-08 10:23:00 +01:00
// The link is a link to the change phone number section of the app
type InternalLinkTypeChangePhoneNumber struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeChangePhoneNumber) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeChangePhoneNumber
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeChangePhoneNumber) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeChangePhoneNumber) GetType() string {
return TypeInternalLinkTypeChangePhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeChangePhoneNumber) InternalLinkTypeType() string {
return TypeInternalLinkTypeChangePhoneNumber
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link
type InternalLinkTypeChatInvite struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Internal representation of the invite link
InviteLink string `json:"invite_link"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeChatInvite) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeChatInvite
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeChatInvite) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeChatInvite) GetType() string {
return TypeInternalLinkTypeChatInvite
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeChatInvite) InternalLinkTypeType() string {
return TypeInternalLinkTypeChatInvite
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The link is a link to the default message auto-delete timer settings section of the app settings
type InternalLinkTypeDefaultMessageAutoDeleteTimerSettings struct {
meta
}
func (entity *InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeDefaultMessageAutoDeleteTimerSettings
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetType() string {
return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings
}
func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) InternalLinkTypeType() string {
return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings
}
// The link is a link to the edit profile section of the app settings
type InternalLinkTypeEditProfileSettings struct {
meta
}
func (entity *InternalLinkTypeEditProfileSettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeEditProfileSettings
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeEditProfileSettings) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeEditProfileSettings) GetType() string {
return TypeInternalLinkTypeEditProfileSettings
}
func (*InternalLinkTypeEditProfileSettings) InternalLinkTypeType() string {
return TypeInternalLinkTypeEditProfileSettings
}
// The link is a link to the filter section of the app settings
type InternalLinkTypeFilterSettings struct {
meta
}
func (entity *InternalLinkTypeFilterSettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeFilterSettings
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeFilterSettings) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeFilterSettings) GetType() string {
return TypeInternalLinkTypeFilterSettings
}
func (*InternalLinkTypeFilterSettings) InternalLinkTypeType() string {
return TypeInternalLinkTypeFilterSettings
}
// The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame
type InternalLinkTypeGame struct {
meta
// Username of the bot that owns the game
BotUsername string `json:"bot_username"`
// Short name of the game
GameShortName string `json:"game_short_name"`
}
func (entity *InternalLinkTypeGame) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeGame
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeGame) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeGame) GetType() string {
return TypeInternalLinkTypeGame
}
func (*InternalLinkTypeGame) InternalLinkTypeType() string {
return TypeInternalLinkTypeGame
}
// The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link
type InternalLinkTypeInstantView struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// URL to be passed to getWebPageInstantView
Url string `json:"url"`
// An URL to open if getWebPageInstantView fails
FallbackUrl string `json:"fallback_url"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *InternalLinkTypeInstantView) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub InternalLinkTypeInstantView
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*InternalLinkTypeInstantView) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*InternalLinkTypeInstantView) GetType() string {
return TypeInternalLinkTypeInstantView
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*InternalLinkTypeInstantView) InternalLinkTypeType() string {
return TypeInternalLinkTypeInstantView
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link
type InternalLinkTypeInvoice struct {
2021-10-22 16:24:12 +02:00
meta
2023-06-04 22:58:07 +02:00
// Name of the invoice
InvoiceName string `json:"invoice_name"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *InternalLinkTypeInvoice) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub InternalLinkTypeInvoice
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*InternalLinkTypeInvoice) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*InternalLinkTypeInvoice) GetType() string {
return TypeInternalLinkTypeInvoice
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*InternalLinkTypeInvoice) InternalLinkTypeType() string {
return TypeInternalLinkTypeInvoice
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link
type InternalLinkTypeLanguagePack struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Language pack identifier
LanguagePackId string `json:"language_pack_id"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeLanguagePack) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeLanguagePack
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeLanguagePack) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeLanguagePack) GetType() string {
return TypeInternalLinkTypeLanguagePack
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeLanguagePack) InternalLinkTypeType() string {
return TypeInternalLinkTypeLanguagePack
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The link is a link to the language section of the app settings
type InternalLinkTypeLanguageSettings struct {
meta
}
func (entity *InternalLinkTypeLanguageSettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeLanguageSettings
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeLanguageSettings) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeLanguageSettings) GetType() string {
return TypeInternalLinkTypeLanguageSettings
}
func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string {
return TypeInternalLinkTypeLanguageSettings
}
// The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link
2021-12-08 10:23:00 +01:00
type InternalLinkTypeMessage struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// URL to be passed to getMessageLinkInfo
Url string `json:"url"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeMessage) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeMessage
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeMessage) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeMessage) GetType() string {
return TypeInternalLinkTypeMessage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeMessage) InternalLinkTypeType() string {
return TypeInternalLinkTypeMessage
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field
type InternalLinkTypeMessageDraft struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Message draft text
Text *FormattedText `json:"text"`
// True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected
ContainsLink bool `json:"contains_link"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeMessageDraft) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeMessageDraft
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeMessageDraft) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeMessageDraft) GetType() string {
return TypeInternalLinkTypeMessageDraft
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeMessageDraft) InternalLinkTypeType() string {
return TypeInternalLinkTypeMessageDraft
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// 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
2021-12-08 10:23:00 +01:00
type InternalLinkTypePassportDataRequest struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// User identifier of the service's bot
BotUserId int64 `json:"bot_user_id"`
// Telegram Passport element types requested by the service
Scope string `json:"scope"`
// Service's public key
PublicKey string `json:"public_key"`
// Unique request identifier provided by the service
Nonce string `json:"nonce"`
// An HTTP URL to open once the request is finished or canceled with the parameter tg_passport=success or tg_passport=cancel respectively. If empty, then the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel needs to be opened instead
CallbackUrl string `json:"callback_url"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypePassportDataRequest) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypePassportDataRequest
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypePassportDataRequest) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypePassportDataRequest) GetType() string {
return TypeInternalLinkTypePassportDataRequest
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypePassportDataRequest) InternalLinkTypeType() string {
return TypeInternalLinkTypePassportDataRequest
}
// The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link
type InternalLinkTypePhoneNumberConfirmation struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Hash value from the link
Hash string `json:"hash"`
// Phone number value from the link
PhoneNumber string `json:"phone_number"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypePhoneNumberConfirmation) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypePhoneNumberConfirmation
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypePhoneNumberConfirmation) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypePhoneNumberConfirmation) GetType() string {
return TypeInternalLinkTypePhoneNumberConfirmation
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypePhoneNumberConfirmation) InternalLinkTypeType() string {
return TypeInternalLinkTypePhoneNumberConfirmation
}
2023-06-04 22:58:07 +02:00
// The link is a link to the Premium features screen of the applcation from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link
type InternalLinkTypePremiumFeatures struct {
meta
// Referrer specified in the link
Referrer string `json:"referrer"`
}
func (entity *InternalLinkTypePremiumFeatures) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypePremiumFeatures
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypePremiumFeatures) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypePremiumFeatures) GetType() string {
return TypeInternalLinkTypePremiumFeatures
}
func (*InternalLinkTypePremiumFeatures) InternalLinkTypeType() string {
return TypeInternalLinkTypePremiumFeatures
}
// The link is a link to the privacy and security section of the app settings
type InternalLinkTypePrivacyAndSecuritySettings struct {
meta
}
func (entity *InternalLinkTypePrivacyAndSecuritySettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypePrivacyAndSecuritySettings
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypePrivacyAndSecuritySettings) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypePrivacyAndSecuritySettings) GetType() string {
return TypeInternalLinkTypePrivacyAndSecuritySettings
}
func (*InternalLinkTypePrivacyAndSecuritySettings) InternalLinkTypeType() string {
return TypeInternalLinkTypePrivacyAndSecuritySettings
}
2022-04-18 22:45:01 +02:00
// The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy
type InternalLinkTypeProxy struct {
meta
// Proxy server IP address
2021-12-08 10:23:00 +01:00
Server string `json:"server"`
// Proxy server port
Port int32 `json:"port"`
// Type of the proxy
Type ProxyType `json:"type"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeProxy) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeProxy
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeProxy) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeProxy) GetType() string {
return TypeInternalLinkTypeProxy
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeProxy) InternalLinkTypeType() string {
return TypeInternalLinkTypeProxy
}
func (internalLinkTypeProxy *InternalLinkTypeProxy) UnmarshalJSON(data []byte) error {
var tmp struct {
Server string `json:"server"`
Port int32 `json:"port"`
Type json.RawMessage `json:"type"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
internalLinkTypeProxy.Server = tmp.Server
internalLinkTypeProxy.Port = tmp.Port
fieldType, _ := UnmarshalProxyType(tmp.Type)
internalLinkTypeProxy.Type = fieldType
return nil
}
// The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link
type InternalLinkTypePublicChat struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Username of the chat
ChatUsername string `json:"chat_username"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypePublicChat) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypePublicChat
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypePublicChat) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypePublicChat) GetType() string {
return TypeInternalLinkTypePublicChat
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypePublicChat) InternalLinkTypeType() string {
return TypeInternalLinkTypePublicChat
}
// The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to "This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown
type InternalLinkTypeQrCodeAuthentication struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeQrCodeAuthentication) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeQrCodeAuthentication
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeQrCodeAuthentication) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeQrCodeAuthentication) GetType() string {
return TypeInternalLinkTypeQrCodeAuthentication
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeQrCodeAuthentication) InternalLinkTypeType() string {
return TypeInternalLinkTypeQrCodeAuthentication
}
2023-06-04 22:58:07 +02:00
// The link forces restore of App Store purchases when opened. For official iOS application only
type InternalLinkTypeRestorePurchases struct {
meta
}
func (entity *InternalLinkTypeRestorePurchases) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeRestorePurchases
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeRestorePurchases) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeRestorePurchases) GetType() string {
return TypeInternalLinkTypeRestorePurchases
}
func (*InternalLinkTypeRestorePurchases) InternalLinkTypeType() string {
return TypeInternalLinkTypeRestorePurchases
}
// The link is a link to application settings
2021-12-08 10:23:00 +01:00
type InternalLinkTypeSettings struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeSettings) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeSettings
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeSettings) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeSettings) GetType() string {
return TypeInternalLinkTypeSettings
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeSettings) InternalLinkTypeType() string {
return TypeInternalLinkTypeSettings
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set
type InternalLinkTypeStickerSet struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Name of the sticker set
StickerSetName string `json:"sticker_set_name"`
2023-06-04 22:58:07 +02:00
// True, if the sticker set is expected to contain custom emoji
ExpectCustomEmoji bool `json:"expect_custom_emoji"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeStickerSet) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeStickerSet
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeStickerSet) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeStickerSet) GetType() string {
return TypeInternalLinkTypeStickerSet
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeStickerSet) InternalLinkTypeType() string {
return TypeInternalLinkTypeStickerSet
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The link is a link to a theme. TDLib has no theme support yet
type InternalLinkTypeTheme struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Name of the theme
ThemeName string `json:"theme_name"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeTheme) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeTheme
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeTheme) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeTheme) GetType() string {
return TypeInternalLinkTypeTheme
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeTheme) InternalLinkTypeType() string {
return TypeInternalLinkTypeTheme
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// The link is a link to the theme section of the app settings
2021-12-08 10:23:00 +01:00
type InternalLinkTypeThemeSettings struct {
2021-10-22 16:24:12 +02:00
meta
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeThemeSettings) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeThemeSettings
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeThemeSettings) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeThemeSettings) GetType() string {
return TypeInternalLinkTypeThemeSettings
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeThemeSettings) InternalLinkTypeType() string {
return TypeInternalLinkTypeThemeSettings
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
// The link is an unknown tg: link. Call getDeepLinkInfo to process the link
type InternalLinkTypeUnknownDeepLink struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Link to be passed to getDeepLinkInfo
Link string `json:"link"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeUnknownDeepLink) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeUnknownDeepLink
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeUnknownDeepLink) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeUnknownDeepLink) GetType() string {
2023-06-04 22:53:18 +02:00
return TypeInternalLinkTypeUnknownDeepLink
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:53:18 +02:00
func (*InternalLinkTypeUnknownDeepLink) InternalLinkTypeType() string {
return TypeInternalLinkTypeUnknownDeepLink
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:53:18 +02:00
// The link is a link to an unsupported proxy. An alert can be shown to the user
type InternalLinkTypeUnsupportedProxy struct {
2022-04-18 22:45:01 +02:00
meta
}
2023-06-04 22:53:18 +02:00
func (entity *InternalLinkTypeUnsupportedProxy) MarshalJSON() ([]byte, error) {
2022-04-18 22:45:01 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:53:18 +02:00
type stub InternalLinkTypeUnsupportedProxy
2022-04-18 22:45:01 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:53:18 +02:00
func (*InternalLinkTypeUnsupportedProxy) GetClass() string {
2022-04-18 22:45:01 +02:00
return ClassInternalLinkType
}
2023-06-04 22:53:18 +02:00
func (*InternalLinkTypeUnsupportedProxy) GetType() string {
return TypeInternalLinkTypeUnsupportedProxy
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:53:18 +02:00
func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string {
return TypeInternalLinkTypeUnsupportedProxy
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link
type InternalLinkTypeUserPhoneNumber struct {
meta
// Phone number of the user
PhoneNumber string `json:"phone_number"`
}
func (entity *InternalLinkTypeUserPhoneNumber) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeUserPhoneNumber
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeUserPhoneNumber) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeUserPhoneNumber) GetType() string {
return TypeInternalLinkTypeUserPhoneNumber
}
func (*InternalLinkTypeUserPhoneNumber) InternalLinkTypeType() string {
return TypeInternalLinkTypeUserPhoneNumber
}
// The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link
type InternalLinkTypeUserToken struct {
meta
// The token
Token string `json:"token"`
}
func (entity *InternalLinkTypeUserToken) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeUserToken
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeUserToken) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeUserToken) GetType() string {
return TypeInternalLinkTypeUserToken
}
func (*InternalLinkTypeUserToken) InternalLinkTypeType() string {
return TypeInternalLinkTypeUserToken
}
// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link
2021-12-08 10:23:00 +01:00
type InternalLinkTypeVideoChat struct {
2021-10-22 16:24:12 +02:00
meta
2021-12-08 10:23:00 +01:00
// Username of the chat with the video chat
ChatUsername string `json:"chat_username"`
// If non-empty, invite hash to be used to join the video chat without being muted by administrators
InviteHash string `json:"invite_hash"`
// True, if the video chat is expected to be a live stream in a channel or a broadcast group
IsLiveStream bool `json:"is_live_stream"`
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (entity *InternalLinkTypeVideoChat) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub InternalLinkTypeVideoChat
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeVideoChat) GetClass() string {
return ClassInternalLinkType
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeVideoChat) GetType() string {
return TypeInternalLinkTypeVideoChat
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*InternalLinkTypeVideoChat) InternalLinkTypeType() string {
return TypeInternalLinkTypeVideoChat
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
// Contains an HTTPS link to a message in a supergroup or channel, or a forum topic
2021-10-22 16:24:12 +02:00
type MessageLink struct {
meta
2023-06-04 22:58:07 +02:00
// The link
2021-10-22 16:24:12 +02:00
Link string `json:"link"`
// True, if the link will work for non-members of the chat
IsPublic bool `json:"is_public"`
}
func (entity *MessageLink) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageLink
return json.Marshal((*stub)(entity))
}
func (*MessageLink) GetClass() string {
return ClassMessageLink
}
func (*MessageLink) GetType() string {
return TypeMessageLink
}
2023-06-04 22:58:07 +02:00
// Contains information about a link to a message or a forum topic in a chat
2021-10-22 16:24:12 +02:00
type MessageLinkInfo struct {
meta
2023-06-04 22:58:07 +02:00
// True, if the link is a public link for a message or a forum topic in a chat
2021-10-22 16:24:12 +02:00
IsPublic bool `json:"is_public"`
2023-06-04 22:58:07 +02:00
// If found, identifier of the chat to which the link points, 0 otherwise
2021-10-22 16:24:12 +02:00
ChatId int64 `json:"chat_id"`
2023-06-04 22:58:07 +02:00
// If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing
MessageThreadId int64 `json:"message_thread_id"`
2021-10-22 16:24:12 +02:00
// If found, the linked message; may be null
Message *Message `json:"message"`
2021-12-08 10:23:00 +01:00
// Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview
MediaTimestamp int32 `json:"media_timestamp"`
2021-10-22 16:24:12 +02:00
// True, if the whole media album to which the message belongs is linked
ForAlbum bool `json:"for_album"`
}
func (entity *MessageLinkInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageLinkInfo
return json.Marshal((*stub)(entity))
}
func (*MessageLinkInfo) GetClass() string {
return ClassMessageLinkInfo
}
func (*MessageLinkInfo) GetType() string {
return TypeMessageLinkInfo
}
// Contains a part of a file
type FilePart struct {
meta
// File bytes
Data []byte `json:"data"`
}
func (entity *FilePart) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FilePart
return json.Marshal((*stub)(entity))
}
func (*FilePart) GetClass() string {
return ClassFilePart
}
func (*FilePart) GetType() string {
return TypeFilePart
}
// The data is not a file
type FileTypeNone struct {
meta
}
func (entity *FileTypeNone) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeNone
return json.Marshal((*stub)(entity))
}
func (*FileTypeNone) GetClass() string {
return ClassFileType
}
func (*FileTypeNone) GetType() string {
return TypeFileTypeNone
}
func (*FileTypeNone) FileTypeType() string {
return TypeFileTypeNone
}
// The file is an animation
type FileTypeAnimation struct {
meta
}
func (entity *FileTypeAnimation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeAnimation
return json.Marshal((*stub)(entity))
}
func (*FileTypeAnimation) GetClass() string {
return ClassFileType
}
func (*FileTypeAnimation) GetType() string {
return TypeFileTypeAnimation
}
func (*FileTypeAnimation) FileTypeType() string {
return TypeFileTypeAnimation
}
// The file is an audio file
type FileTypeAudio struct {
meta
}
func (entity *FileTypeAudio) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeAudio
return json.Marshal((*stub)(entity))
}
func (*FileTypeAudio) GetClass() string {
return ClassFileType
}
func (*FileTypeAudio) GetType() string {
return TypeFileTypeAudio
}
func (*FileTypeAudio) FileTypeType() string {
return TypeFileTypeAudio
}
// The file is a document
type FileTypeDocument struct {
meta
}
func (entity *FileTypeDocument) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeDocument
return json.Marshal((*stub)(entity))
}
func (*FileTypeDocument) GetClass() string {
return ClassFileType
}
func (*FileTypeDocument) GetType() string {
return TypeFileTypeDocument
}
func (*FileTypeDocument) FileTypeType() string {
return TypeFileTypeDocument
}
2023-06-04 22:58:07 +02:00
// The file is a notification sound
type FileTypeNotificationSound struct {
meta
}
func (entity *FileTypeNotificationSound) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeNotificationSound
return json.Marshal((*stub)(entity))
}
func (*FileTypeNotificationSound) GetClass() string {
return ClassFileType
}
func (*FileTypeNotificationSound) GetType() string {
return TypeFileTypeNotificationSound
}
func (*FileTypeNotificationSound) FileTypeType() string {
return TypeFileTypeNotificationSound
}
2021-10-22 16:24:12 +02:00
// The file is a photo
type FileTypePhoto struct {
meta
}
func (entity *FileTypePhoto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypePhoto
return json.Marshal((*stub)(entity))
}
func (*FileTypePhoto) GetClass() string {
return ClassFileType
}
func (*FileTypePhoto) GetType() string {
return TypeFileTypePhoto
}
func (*FileTypePhoto) FileTypeType() string {
return TypeFileTypePhoto
}
// The file is a profile photo
type FileTypeProfilePhoto struct {
meta
}
func (entity *FileTypeProfilePhoto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeProfilePhoto
return json.Marshal((*stub)(entity))
}
func (*FileTypeProfilePhoto) GetClass() string {
return ClassFileType
}
func (*FileTypeProfilePhoto) GetType() string {
return TypeFileTypeProfilePhoto
}
func (*FileTypeProfilePhoto) FileTypeType() string {
return TypeFileTypeProfilePhoto
}
// The file was sent to a secret chat (the file type is not known to the server)
type FileTypeSecret struct {
meta
}
func (entity *FileTypeSecret) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeSecret
return json.Marshal((*stub)(entity))
}
func (*FileTypeSecret) GetClass() string {
return ClassFileType
}
func (*FileTypeSecret) GetType() string {
return TypeFileTypeSecret
}
func (*FileTypeSecret) FileTypeType() string {
return TypeFileTypeSecret
}
// The file is a thumbnail of a file from a secret chat
type FileTypeSecretThumbnail struct {
meta
}
func (entity *FileTypeSecretThumbnail) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeSecretThumbnail
return json.Marshal((*stub)(entity))
}
func (*FileTypeSecretThumbnail) GetClass() string {
return ClassFileType
}
func (*FileTypeSecretThumbnail) GetType() string {
return TypeFileTypeSecretThumbnail
}
func (*FileTypeSecretThumbnail) FileTypeType() string {
return TypeFileTypeSecretThumbnail
}
// The file is a file from Secure storage used for storing Telegram Passport files
type FileTypeSecure struct {
meta
}
func (entity *FileTypeSecure) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeSecure
return json.Marshal((*stub)(entity))
}
func (*FileTypeSecure) GetClass() string {
return ClassFileType
}
func (*FileTypeSecure) GetType() string {
return TypeFileTypeSecure
}
func (*FileTypeSecure) FileTypeType() string {
return TypeFileTypeSecure
}
// The file is a sticker
type FileTypeSticker struct {
meta
}
func (entity *FileTypeSticker) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeSticker
return json.Marshal((*stub)(entity))
}
func (*FileTypeSticker) GetClass() string {
return ClassFileType
}
func (*FileTypeSticker) GetType() string {
return TypeFileTypeSticker
}
func (*FileTypeSticker) FileTypeType() string {
return TypeFileTypeSticker
}
// The file is a thumbnail of another file
type FileTypeThumbnail struct {
meta
}
func (entity *FileTypeThumbnail) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeThumbnail
return json.Marshal((*stub)(entity))
}
func (*FileTypeThumbnail) GetClass() string {
return ClassFileType
}
func (*FileTypeThumbnail) GetType() string {
return TypeFileTypeThumbnail
}
func (*FileTypeThumbnail) FileTypeType() string {
return TypeFileTypeThumbnail
}
// The file type is not yet known
type FileTypeUnknown struct {
meta
}
func (entity *FileTypeUnknown) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeUnknown
return json.Marshal((*stub)(entity))
}
func (*FileTypeUnknown) GetClass() string {
return ClassFileType
}
func (*FileTypeUnknown) GetType() string {
return TypeFileTypeUnknown
}
func (*FileTypeUnknown) FileTypeType() string {
return TypeFileTypeUnknown
}
// The file is a video
type FileTypeVideo struct {
meta
}
func (entity *FileTypeVideo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeVideo
return json.Marshal((*stub)(entity))
}
func (*FileTypeVideo) GetClass() string {
return ClassFileType
}
func (*FileTypeVideo) GetType() string {
return TypeFileTypeVideo
}
func (*FileTypeVideo) FileTypeType() string {
return TypeFileTypeVideo
}
// The file is a video note
type FileTypeVideoNote struct {
meta
}
func (entity *FileTypeVideoNote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeVideoNote
return json.Marshal((*stub)(entity))
}
func (*FileTypeVideoNote) GetClass() string {
return ClassFileType
}
func (*FileTypeVideoNote) GetType() string {
return TypeFileTypeVideoNote
}
func (*FileTypeVideoNote) FileTypeType() string {
return TypeFileTypeVideoNote
}
// The file is a voice note
type FileTypeVoiceNote struct {
meta
}
func (entity *FileTypeVoiceNote) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeVoiceNote
return json.Marshal((*stub)(entity))
}
func (*FileTypeVoiceNote) GetClass() string {
return ClassFileType
}
func (*FileTypeVoiceNote) GetType() string {
return TypeFileTypeVoiceNote
}
func (*FileTypeVoiceNote) FileTypeType() string {
return TypeFileTypeVoiceNote
}
// The file is a wallpaper or a background pattern
type FileTypeWallpaper struct {
meta
}
func (entity *FileTypeWallpaper) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileTypeWallpaper
return json.Marshal((*stub)(entity))
}
func (*FileTypeWallpaper) GetClass() string {
return ClassFileType
}
func (*FileTypeWallpaper) GetType() string {
return TypeFileTypeWallpaper
}
func (*FileTypeWallpaper) FileTypeType() string {
return TypeFileTypeWallpaper
}
// Contains the storage usage statistics for a specific file type
type StorageStatisticsByFileType struct {
meta
// File type
FileType FileType `json:"file_type"`
2021-12-08 10:23:00 +01:00
// Total size of the files, in bytes
2021-10-22 16:24:12 +02:00
Size int64 `json:"size"`
// Total number of files
Count int32 `json:"count"`
}
func (entity *StorageStatisticsByFileType) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StorageStatisticsByFileType
return json.Marshal((*stub)(entity))
}
func (*StorageStatisticsByFileType) GetClass() string {
return ClassStorageStatisticsByFileType
}
func (*StorageStatisticsByFileType) GetType() string {
return TypeStorageStatisticsByFileType
}
func (storageStatisticsByFileType *StorageStatisticsByFileType) UnmarshalJSON(data []byte) error {
var tmp struct {
FileType json.RawMessage `json:"file_type"`
Size int64 `json:"size"`
Count int32 `json:"count"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
storageStatisticsByFileType.Size = tmp.Size
storageStatisticsByFileType.Count = tmp.Count
fieldFileType, _ := UnmarshalFileType(tmp.FileType)
storageStatisticsByFileType.FileType = fieldFileType
return nil
}
// Contains the storage usage statistics for a specific chat
type StorageStatisticsByChat struct {
meta
// Chat identifier; 0 if none
ChatId int64 `json:"chat_id"`
2021-12-08 10:23:00 +01:00
// Total size of the files in the chat, in bytes
2021-10-22 16:24:12 +02:00
Size int64 `json:"size"`
// Total number of files in the chat
Count int32 `json:"count"`
// Statistics split by file types
ByFileType []*StorageStatisticsByFileType `json:"by_file_type"`
}
func (entity *StorageStatisticsByChat) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StorageStatisticsByChat
return json.Marshal((*stub)(entity))
}
func (*StorageStatisticsByChat) GetClass() string {
return ClassStorageStatisticsByChat
}
func (*StorageStatisticsByChat) GetType() string {
return TypeStorageStatisticsByChat
}
// Contains the exact storage usage statistics split by chats and file type
type StorageStatistics struct {
meta
2021-12-08 10:23:00 +01:00
// Total size of files, in bytes
2021-10-22 16:24:12 +02:00
Size int64 `json:"size"`
// Total number of files
Count int32 `json:"count"`
// Statistics split by chats
ByChat []*StorageStatisticsByChat `json:"by_chat"`
}
func (entity *StorageStatistics) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StorageStatistics
return json.Marshal((*stub)(entity))
}
func (*StorageStatistics) GetClass() string {
return ClassStorageStatistics
}
func (*StorageStatistics) GetType() string {
return TypeStorageStatistics
}
// Contains approximate storage usage statistics, excluding files of unknown file type
type StorageStatisticsFast struct {
meta
2021-12-08 10:23:00 +01:00
// Approximate total size of files, in bytes
2021-10-22 16:24:12 +02:00
FilesSize int64 `json:"files_size"`
// Approximate number of files
FileCount int32 `json:"file_count"`
// Size of the database
DatabaseSize int64 `json:"database_size"`
// Size of the language pack database
LanguagePackDatabaseSize int64 `json:"language_pack_database_size"`
// Size of the TDLib internal log
LogSize int64 `json:"log_size"`
}
func (entity *StorageStatisticsFast) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StorageStatisticsFast
return json.Marshal((*stub)(entity))
}
func (*StorageStatisticsFast) GetClass() string {
return ClassStorageStatisticsFast
}
func (*StorageStatisticsFast) GetType() string {
return TypeStorageStatisticsFast
}
// Contains database statistics
type DatabaseStatistics struct {
meta
// Database statistics in an unspecified human-readable format
Statistics string `json:"statistics"`
}
func (entity *DatabaseStatistics) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DatabaseStatistics
return json.Marshal((*stub)(entity))
}
func (*DatabaseStatistics) GetClass() string {
return ClassDatabaseStatistics
}
func (*DatabaseStatistics) GetType() string {
return TypeDatabaseStatistics
}
// The network is not available
type NetworkTypeNone struct {
meta
}
func (entity *NetworkTypeNone) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub NetworkTypeNone
return json.Marshal((*stub)(entity))
}
func (*NetworkTypeNone) GetClass() string {
return ClassNetworkType
}
func (*NetworkTypeNone) GetType() string {
return TypeNetworkTypeNone
}
func (*NetworkTypeNone) NetworkTypeType() string {
return TypeNetworkTypeNone
}
// A mobile network
type NetworkTypeMobile struct {
meta
}
func (entity *NetworkTypeMobile) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub NetworkTypeMobile
return json.Marshal((*stub)(entity))
}
func (*NetworkTypeMobile) GetClass() string {
return ClassNetworkType
}
func (*NetworkTypeMobile) GetType() string {
return TypeNetworkTypeMobile
}
func (*NetworkTypeMobile) NetworkTypeType() string {
return TypeNetworkTypeMobile
}
// A mobile roaming network
type NetworkTypeMobileRoaming struct {
meta
}
func (entity *NetworkTypeMobileRoaming) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub NetworkTypeMobileRoaming
return json.Marshal((*stub)(entity))
}
func (*NetworkTypeMobileRoaming) GetClass() string {
return ClassNetworkType
}
func (*NetworkTypeMobileRoaming) GetType() string {
return TypeNetworkTypeMobileRoaming
}
func (*NetworkTypeMobileRoaming) NetworkTypeType() string {
return TypeNetworkTypeMobileRoaming
}
// A Wi-Fi network
type NetworkTypeWiFi struct {
meta
}
func (entity *NetworkTypeWiFi) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub NetworkTypeWiFi
return json.Marshal((*stub)(entity))
}
func (*NetworkTypeWiFi) GetClass() string {
return ClassNetworkType
}
func (*NetworkTypeWiFi) GetType() string {
return TypeNetworkTypeWiFi
}
func (*NetworkTypeWiFi) NetworkTypeType() string {
return TypeNetworkTypeWiFi
}
// A different network type (e.g., Ethernet network)
type NetworkTypeOther struct {
meta
}
func (entity *NetworkTypeOther) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub NetworkTypeOther
return json.Marshal((*stub)(entity))
}
func (*NetworkTypeOther) GetClass() string {
return ClassNetworkType
}
func (*NetworkTypeOther) GetType() string {
return TypeNetworkTypeOther
}
func (*NetworkTypeOther) NetworkTypeType() string {
return TypeNetworkTypeOther
}
// Contains information about the total amount of data that was used to send and receive files
type NetworkStatisticsEntryFile struct {
meta
2021-12-08 10:23:00 +01:00
// Type of the file the data is part of; pass null if the data isn't related to files
2021-10-22 16:24:12 +02:00
FileType FileType `json:"file_type"`
// Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
NetworkType NetworkType `json:"network_type"`
// Total number of bytes sent
SentBytes int64 `json:"sent_bytes"`
// Total number of bytes received
ReceivedBytes int64 `json:"received_bytes"`
}
func (entity *NetworkStatisticsEntryFile) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub NetworkStatisticsEntryFile
return json.Marshal((*stub)(entity))
}
func (*NetworkStatisticsEntryFile) GetClass() string {
return ClassNetworkStatisticsEntry
}
func (*NetworkStatisticsEntryFile) GetType() string {
return TypeNetworkStatisticsEntryFile
}
func (*NetworkStatisticsEntryFile) NetworkStatisticsEntryType() string {
return TypeNetworkStatisticsEntryFile
}
func (networkStatisticsEntryFile *NetworkStatisticsEntryFile) UnmarshalJSON(data []byte) error {
var tmp struct {
FileType json.RawMessage `json:"file_type"`
NetworkType json.RawMessage `json:"network_type"`
SentBytes int64 `json:"sent_bytes"`
ReceivedBytes int64 `json:"received_bytes"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
networkStatisticsEntryFile.SentBytes = tmp.SentBytes
networkStatisticsEntryFile.ReceivedBytes = tmp.ReceivedBytes
fieldFileType, _ := UnmarshalFileType(tmp.FileType)
networkStatisticsEntryFile.FileType = fieldFileType
fieldNetworkType, _ := UnmarshalNetworkType(tmp.NetworkType)
networkStatisticsEntryFile.NetworkType = fieldNetworkType
return nil
}
// Contains information about the total amount of data that was used for calls
type NetworkStatisticsEntryCall struct {
meta
// Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
NetworkType NetworkType `json:"network_type"`
// Total number of bytes sent
SentBytes int64 `json:"sent_bytes"`
// Total number of bytes received
ReceivedBytes int64 `json:"received_bytes"`
// Total call duration, in seconds
Duration float64 `json:"duration"`
}
func (entity *NetworkStatisticsEntryCall) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub NetworkStatisticsEntryCall
return json.Marshal((*stub)(entity))
}
func (*NetworkStatisticsEntryCall) GetClass() string {
return ClassNetworkStatisticsEntry
}
func (*NetworkStatisticsEntryCall) GetType() string {
return TypeNetworkStatisticsEntryCall
}
func (*NetworkStatisticsEntryCall) NetworkStatisticsEntryType() string {
return TypeNetworkStatisticsEntryCall
}
func (networkStatisticsEntryCall *NetworkStatisticsEntryCall) UnmarshalJSON(data []byte) error {
var tmp struct {
NetworkType json.RawMessage `json:"network_type"`
SentBytes int64 `json:"sent_bytes"`
ReceivedBytes int64 `json:"received_bytes"`
Duration float64 `json:"duration"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
networkStatisticsEntryCall.SentBytes = tmp.SentBytes
networkStatisticsEntryCall.ReceivedBytes = tmp.ReceivedBytes
networkStatisticsEntryCall.Duration = tmp.Duration
fieldNetworkType, _ := UnmarshalNetworkType(tmp.NetworkType)
networkStatisticsEntryCall.NetworkType = fieldNetworkType
return nil
}
// A full list of available network statistic entries
type NetworkStatistics struct {
meta
// Point in time (Unix timestamp) from which the statistics are collected
SinceDate int32 `json:"since_date"`
// Network statistics entries
Entries []NetworkStatisticsEntry `json:"entries"`
}
func (entity *NetworkStatistics) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub NetworkStatistics
return json.Marshal((*stub)(entity))
}
func (*NetworkStatistics) GetClass() string {
return ClassNetworkStatistics
}
func (*NetworkStatistics) GetType() string {
return TypeNetworkStatistics
}
func (networkStatistics *NetworkStatistics) UnmarshalJSON(data []byte) error {
var tmp struct {
SinceDate int32 `json:"since_date"`
Entries []json.RawMessage `json:"entries"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
networkStatistics.SinceDate = tmp.SinceDate
fieldEntries, _ := UnmarshalListOfNetworkStatisticsEntry(tmp.Entries)
networkStatistics.Entries = fieldEntries
return nil
}
// Contains auto-download settings
type AutoDownloadSettings struct {
meta
// True, if the auto-download is enabled
IsAutoDownloadEnabled bool `json:"is_auto_download_enabled"`
2021-12-08 10:23:00 +01:00
// The maximum size of a photo file to be auto-downloaded, in bytes
2021-10-22 16:24:12 +02:00
MaxPhotoFileSize int32 `json:"max_photo_file_size"`
2021-12-08 10:23:00 +01:00
// The maximum size of a video file to be auto-downloaded, in bytes
2023-06-04 22:58:07 +02:00
MaxVideoFileSize int64 `json:"max_video_file_size"`
2021-12-08 10:23:00 +01:00
// The maximum size of other file types to be auto-downloaded, in bytes
2023-06-04 22:58:07 +02:00
MaxOtherFileSize int64 `json:"max_other_file_size"`
2021-12-08 10:23:00 +01:00
// The maximum suggested bitrate for uploaded videos, in kbit/s
2021-10-22 16:24:12 +02:00
VideoUploadBitrate int32 `json:"video_upload_bitrate"`
// True, if the beginning of video files needs to be preloaded for instant playback
PreloadLargeVideos bool `json:"preload_large_videos"`
// True, if the next audio track needs to be preloaded while the user is listening to an audio file
PreloadNextAudio bool `json:"preload_next_audio"`
// True, if "use less data for calls" option needs to be enabled
UseLessDataForCalls bool `json:"use_less_data_for_calls"`
}
func (entity *AutoDownloadSettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AutoDownloadSettings
return json.Marshal((*stub)(entity))
}
func (*AutoDownloadSettings) GetClass() string {
return ClassAutoDownloadSettings
}
func (*AutoDownloadSettings) GetType() string {
return TypeAutoDownloadSettings
}
2021-12-08 10:23:00 +01:00
// Contains auto-download settings presets for the current user
2021-10-22 16:24:12 +02:00
type AutoDownloadSettingsPresets struct {
meta
// Preset with lowest settings; supposed to be used by default when roaming
Low *AutoDownloadSettings `json:"low"`
// Preset with medium settings; supposed to be used by default when using mobile data
Medium *AutoDownloadSettings `json:"medium"`
// Preset with highest settings; supposed to be used by default when connected on Wi-Fi
High *AutoDownloadSettings `json:"high"`
}
func (entity *AutoDownloadSettingsPresets) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AutoDownloadSettingsPresets
return json.Marshal((*stub)(entity))
}
func (*AutoDownloadSettingsPresets) GetClass() string {
return ClassAutoDownloadSettingsPresets
}
func (*AutoDownloadSettingsPresets) GetType() string {
return TypeAutoDownloadSettingsPresets
}
// Currently waiting for the network to become available. Use setNetworkType to change the available network type
type ConnectionStateWaitingForNetwork struct {
meta
}
func (entity *ConnectionStateWaitingForNetwork) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ConnectionStateWaitingForNetwork
return json.Marshal((*stub)(entity))
}
func (*ConnectionStateWaitingForNetwork) GetClass() string {
return ClassConnectionState
}
func (*ConnectionStateWaitingForNetwork) GetType() string {
return TypeConnectionStateWaitingForNetwork
}
func (*ConnectionStateWaitingForNetwork) ConnectionStateType() string {
return TypeConnectionStateWaitingForNetwork
}
// Currently establishing a connection with a proxy server
type ConnectionStateConnectingToProxy struct {
meta
}
func (entity *ConnectionStateConnectingToProxy) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ConnectionStateConnectingToProxy
return json.Marshal((*stub)(entity))
}
func (*ConnectionStateConnectingToProxy) GetClass() string {
return ClassConnectionState
}
func (*ConnectionStateConnectingToProxy) GetType() string {
return TypeConnectionStateConnectingToProxy
}
func (*ConnectionStateConnectingToProxy) ConnectionStateType() string {
return TypeConnectionStateConnectingToProxy
}
// Currently establishing a connection to the Telegram servers
type ConnectionStateConnecting struct {
meta
}
func (entity *ConnectionStateConnecting) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ConnectionStateConnecting
return json.Marshal((*stub)(entity))
}
func (*ConnectionStateConnecting) GetClass() string {
return ClassConnectionState
}
func (*ConnectionStateConnecting) GetType() string {
return TypeConnectionStateConnecting
}
func (*ConnectionStateConnecting) ConnectionStateType() string {
return TypeConnectionStateConnecting
}
// Downloading data received while the application was offline
type ConnectionStateUpdating struct {
meta
}
func (entity *ConnectionStateUpdating) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ConnectionStateUpdating
return json.Marshal((*stub)(entity))
}
func (*ConnectionStateUpdating) GetClass() string {
return ClassConnectionState
}
func (*ConnectionStateUpdating) GetType() string {
return TypeConnectionStateUpdating
}
func (*ConnectionStateUpdating) ConnectionStateType() string {
return TypeConnectionStateUpdating
}
// There is a working connection to the Telegram servers
type ConnectionStateReady struct {
meta
}
func (entity *ConnectionStateReady) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ConnectionStateReady
return json.Marshal((*stub)(entity))
}
func (*ConnectionStateReady) GetClass() string {
return ClassConnectionState
}
func (*ConnectionStateReady) GetType() string {
return TypeConnectionStateReady
}
func (*ConnectionStateReady) ConnectionStateType() string {
return TypeConnectionStateReady
}
// A category containing frequently used private chats with non-bot users
type TopChatCategoryUsers struct {
meta
}
func (entity *TopChatCategoryUsers) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TopChatCategoryUsers
return json.Marshal((*stub)(entity))
}
func (*TopChatCategoryUsers) GetClass() string {
return ClassTopChatCategory
}
func (*TopChatCategoryUsers) GetType() string {
return TypeTopChatCategoryUsers
}
func (*TopChatCategoryUsers) TopChatCategoryType() string {
return TypeTopChatCategoryUsers
}
// A category containing frequently used private chats with bot users
type TopChatCategoryBots struct {
meta
}
func (entity *TopChatCategoryBots) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TopChatCategoryBots
return json.Marshal((*stub)(entity))
}
func (*TopChatCategoryBots) GetClass() string {
return ClassTopChatCategory
}
func (*TopChatCategoryBots) GetType() string {
return TypeTopChatCategoryBots
}
func (*TopChatCategoryBots) TopChatCategoryType() string {
return TypeTopChatCategoryBots
}
// A category containing frequently used basic groups and supergroups
type TopChatCategoryGroups struct {
meta
}
func (entity *TopChatCategoryGroups) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TopChatCategoryGroups
return json.Marshal((*stub)(entity))
}
func (*TopChatCategoryGroups) GetClass() string {
return ClassTopChatCategory
}
func (*TopChatCategoryGroups) GetType() string {
return TypeTopChatCategoryGroups
}
func (*TopChatCategoryGroups) TopChatCategoryType() string {
return TypeTopChatCategoryGroups
}
// A category containing frequently used channels
type TopChatCategoryChannels struct {
meta
}
func (entity *TopChatCategoryChannels) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TopChatCategoryChannels
return json.Marshal((*stub)(entity))
}
func (*TopChatCategoryChannels) GetClass() string {
return ClassTopChatCategory
}
func (*TopChatCategoryChannels) GetType() string {
return TypeTopChatCategoryChannels
}
func (*TopChatCategoryChannels) TopChatCategoryType() string {
return TypeTopChatCategoryChannels
}
// A category containing frequently used chats with inline bots sorted by their usage in inline mode
type TopChatCategoryInlineBots struct {
meta
}
func (entity *TopChatCategoryInlineBots) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TopChatCategoryInlineBots
return json.Marshal((*stub)(entity))
}
func (*TopChatCategoryInlineBots) GetClass() string {
return ClassTopChatCategory
}
func (*TopChatCategoryInlineBots) GetType() string {
return TypeTopChatCategoryInlineBots
}
func (*TopChatCategoryInlineBots) TopChatCategoryType() string {
return TypeTopChatCategoryInlineBots
}
// A category containing frequently used chats used for calls
type TopChatCategoryCalls struct {
meta
}
func (entity *TopChatCategoryCalls) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TopChatCategoryCalls
return json.Marshal((*stub)(entity))
}
func (*TopChatCategoryCalls) GetClass() string {
return ClassTopChatCategory
}
func (*TopChatCategoryCalls) GetType() string {
return TypeTopChatCategoryCalls
}
func (*TopChatCategoryCalls) TopChatCategoryType() string {
return TypeTopChatCategoryCalls
}
// A category containing frequently used chats used to forward messages
type TopChatCategoryForwardChats struct {
meta
}
func (entity *TopChatCategoryForwardChats) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TopChatCategoryForwardChats
return json.Marshal((*stub)(entity))
}
func (*TopChatCategoryForwardChats) GetClass() string {
return ClassTopChatCategory
}
func (*TopChatCategoryForwardChats) GetType() string {
return TypeTopChatCategoryForwardChats
}
func (*TopChatCategoryForwardChats) TopChatCategoryType() string {
return TypeTopChatCategoryForwardChats
}
// A URL linking to a user
type TMeUrlTypeUser struct {
meta
// Identifier of the user
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
}
func (entity *TMeUrlTypeUser) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TMeUrlTypeUser
return json.Marshal((*stub)(entity))
}
func (*TMeUrlTypeUser) GetClass() string {
return ClassTMeUrlType
}
func (*TMeUrlTypeUser) GetType() string {
return TypeTMeUrlTypeUser
}
func (*TMeUrlTypeUser) TMeUrlTypeType() string {
return TypeTMeUrlTypeUser
}
// A URL linking to a public supergroup or channel
type TMeUrlTypeSupergroup struct {
meta
// Identifier of the supergroup or channel
SupergroupId int64 `json:"supergroup_id"`
}
func (entity *TMeUrlTypeSupergroup) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TMeUrlTypeSupergroup
return json.Marshal((*stub)(entity))
}
func (*TMeUrlTypeSupergroup) GetClass() string {
return ClassTMeUrlType
}
func (*TMeUrlTypeSupergroup) GetType() string {
return TypeTMeUrlTypeSupergroup
}
func (*TMeUrlTypeSupergroup) TMeUrlTypeType() string {
return TypeTMeUrlTypeSupergroup
}
// A chat invite link
type TMeUrlTypeChatInvite struct {
meta
2023-06-04 22:58:07 +02:00
// Information about the chat invite link
2021-10-22 16:24:12 +02:00
Info *ChatInviteLinkInfo `json:"info"`
}
func (entity *TMeUrlTypeChatInvite) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TMeUrlTypeChatInvite
return json.Marshal((*stub)(entity))
}
func (*TMeUrlTypeChatInvite) GetClass() string {
return ClassTMeUrlType
}
func (*TMeUrlTypeChatInvite) GetType() string {
return TypeTMeUrlTypeChatInvite
}
func (*TMeUrlTypeChatInvite) TMeUrlTypeType() string {
return TypeTMeUrlTypeChatInvite
}
// A URL linking to a sticker set
type TMeUrlTypeStickerSet struct {
meta
// Identifier of the sticker set
StickerSetId JsonInt64 `json:"sticker_set_id"`
}
func (entity *TMeUrlTypeStickerSet) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TMeUrlTypeStickerSet
return json.Marshal((*stub)(entity))
}
func (*TMeUrlTypeStickerSet) GetClass() string {
return ClassTMeUrlType
}
func (*TMeUrlTypeStickerSet) GetType() string {
return TypeTMeUrlTypeStickerSet
}
func (*TMeUrlTypeStickerSet) TMeUrlTypeType() string {
return TypeTMeUrlTypeStickerSet
}
// Represents a URL linking to an internal Telegram entity
type TMeUrl struct {
meta
// URL
Url string `json:"url"`
// Type of the URL
Type TMeUrlType `json:"type"`
}
func (entity *TMeUrl) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TMeUrl
return json.Marshal((*stub)(entity))
}
func (*TMeUrl) GetClass() string {
return ClassTMeUrl
}
func (*TMeUrl) GetType() string {
return TypeTMeUrl
}
func (tMeUrl *TMeUrl) UnmarshalJSON(data []byte) error {
var tmp struct {
Url string `json:"url"`
Type json.RawMessage `json:"type"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
tMeUrl.Url = tmp.Url
fieldType, _ := UnmarshalTMeUrlType(tmp.Type)
tMeUrl.Type = fieldType
return nil
}
// Contains a list of t.me URLs
type TMeUrls struct {
meta
// List of URLs
Urls []*TMeUrl `json:"urls"`
}
func (entity *TMeUrls) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TMeUrls
return json.Marshal((*stub)(entity))
}
func (*TMeUrls) GetClass() string {
return ClassTMeUrls
}
func (*TMeUrls) GetType() string {
return TypeTMeUrls
}
// Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option
type SuggestedActionEnableArchiveAndMuteNewChats struct {
meta
}
func (entity *SuggestedActionEnableArchiveAndMuteNewChats) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SuggestedActionEnableArchiveAndMuteNewChats
return json.Marshal((*stub)(entity))
}
func (*SuggestedActionEnableArchiveAndMuteNewChats) GetClass() string {
return ClassSuggestedAction
}
func (*SuggestedActionEnableArchiveAndMuteNewChats) GetType() string {
return TypeSuggestedActionEnableArchiveAndMuteNewChats
}
func (*SuggestedActionEnableArchiveAndMuteNewChats) SuggestedActionType() string {
return TypeSuggestedActionEnableArchiveAndMuteNewChats
}
2022-04-18 22:45:01 +02:00
// Suggests the user to check whether they still remember their 2-step verification password
2021-12-08 10:23:00 +01:00
type SuggestedActionCheckPassword struct {
meta
}
func (entity *SuggestedActionCheckPassword) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SuggestedActionCheckPassword
return json.Marshal((*stub)(entity))
}
func (*SuggestedActionCheckPassword) GetClass() string {
return ClassSuggestedAction
}
func (*SuggestedActionCheckPassword) GetType() string {
return TypeSuggestedActionCheckPassword
}
func (*SuggestedActionCheckPassword) SuggestedActionType() string {
return TypeSuggestedActionCheckPassword
}
// Suggests the user to check whether authorization phone number is correct and change the phone number if it is inaccessible
2021-10-22 16:24:12 +02:00
type SuggestedActionCheckPhoneNumber struct {
meta
}
func (entity *SuggestedActionCheckPhoneNumber) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SuggestedActionCheckPhoneNumber
return json.Marshal((*stub)(entity))
}
func (*SuggestedActionCheckPhoneNumber) GetClass() string {
return ClassSuggestedAction
}
func (*SuggestedActionCheckPhoneNumber) GetType() string {
return TypeSuggestedActionCheckPhoneNumber
}
func (*SuggestedActionCheckPhoneNumber) SuggestedActionType() string {
return TypeSuggestedActionCheckPhoneNumber
}
2022-04-18 22:45:01 +02:00
// Suggests the user to view a hint about the meaning of one and two check marks on sent messages
type SuggestedActionViewChecksHint struct {
2021-12-08 10:23:00 +01:00
meta
}
2022-04-18 22:45:01 +02:00
func (entity *SuggestedActionViewChecksHint) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub SuggestedActionViewChecksHint
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*SuggestedActionViewChecksHint) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassSuggestedAction
}
2022-04-18 22:45:01 +02:00
func (*SuggestedActionViewChecksHint) GetType() string {
return TypeSuggestedActionViewChecksHint
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
func (*SuggestedActionViewChecksHint) SuggestedActionType() string {
return TypeSuggestedActionViewChecksHint
2021-12-08 10:23:00 +01:00
}
// Suggests the user to convert specified supergroup to a broadcast group
type SuggestedActionConvertToBroadcastGroup struct {
meta
// Supergroup identifier
SupergroupId int64 `json:"supergroup_id"`
}
func (entity *SuggestedActionConvertToBroadcastGroup) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SuggestedActionConvertToBroadcastGroup
return json.Marshal((*stub)(entity))
}
func (*SuggestedActionConvertToBroadcastGroup) GetClass() string {
return ClassSuggestedAction
}
func (*SuggestedActionConvertToBroadcastGroup) GetType() string {
return TypeSuggestedActionConvertToBroadcastGroup
}
func (*SuggestedActionConvertToBroadcastGroup) SuggestedActionType() string {
return TypeSuggestedActionConvertToBroadcastGroup
}
// Suggests the user to set a 2-step verification password to be able to log in again
type SuggestedActionSetPassword struct {
meta
// The number of days to pass between consecutive authorizations if the user declines to set password
AuthorizationDelay int32 `json:"authorization_delay"`
}
func (entity *SuggestedActionSetPassword) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub SuggestedActionSetPassword
return json.Marshal((*stub)(entity))
}
func (*SuggestedActionSetPassword) GetClass() string {
return ClassSuggestedAction
}
func (*SuggestedActionSetPassword) GetType() string {
return TypeSuggestedActionSetPassword
}
func (*SuggestedActionSetPassword) SuggestedActionType() string {
return TypeSuggestedActionSetPassword
}
2021-10-22 16:24:12 +02:00
// Contains a counter
type Count struct {
meta
// Count
Count int32 `json:"count"`
}
func (entity *Count) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Count
return json.Marshal((*stub)(entity))
}
func (*Count) GetClass() string {
return ClassCount
}
func (*Count) GetType() string {
return TypeCount
}
// Contains some text
type Text struct {
meta
// Text
Text string `json:"text"`
}
func (entity *Text) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Text
return json.Marshal((*stub)(entity))
}
func (*Text) GetClass() string {
return ClassText
}
func (*Text) GetType() string {
return TypeText
}
// Contains a value representing a number of seconds
type Seconds struct {
meta
// Number of seconds
Seconds float64 `json:"seconds"`
}
func (entity *Seconds) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Seconds
return json.Marshal((*stub)(entity))
}
func (*Seconds) GetClass() string {
return ClassSeconds
}
func (*Seconds) GetType() string {
return TypeSeconds
}
2023-06-04 22:58:07 +02:00
// Contains size of downloaded prefix of a file
type FileDownloadedPrefixSize struct {
meta
// The prefix size, in bytes
Size int64 `json:"size"`
}
func (entity *FileDownloadedPrefixSize) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub FileDownloadedPrefixSize
return json.Marshal((*stub)(entity))
}
func (*FileDownloadedPrefixSize) GetClass() string {
return ClassFileDownloadedPrefixSize
}
func (*FileDownloadedPrefixSize) GetType() string {
return TypeFileDownloadedPrefixSize
}
2021-12-08 10:23:00 +01:00
// Contains information about a tg: deep link
2021-10-22 16:24:12 +02:00
type DeepLinkInfo struct {
meta
// Text to be shown to the user
Text *FormattedText `json:"text"`
2021-12-08 10:23:00 +01:00
// True, if the user must be asked to update the application
2021-10-22 16:24:12 +02:00
NeedUpdateApplication bool `json:"need_update_application"`
}
func (entity *DeepLinkInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DeepLinkInfo
return json.Marshal((*stub)(entity))
}
func (*DeepLinkInfo) GetClass() string {
return ClassDeepLinkInfo
}
func (*DeepLinkInfo) GetType() string {
return TypeDeepLinkInfo
}
// The text uses Markdown-style formatting
type TextParseModeMarkdown struct {
meta
// Version of the parser: 0 or 1 - Telegram Bot API "Markdown" parse mode, 2 - Telegram Bot API "MarkdownV2" parse mode
Version int32 `json:"version"`
}
func (entity *TextParseModeMarkdown) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TextParseModeMarkdown
return json.Marshal((*stub)(entity))
}
func (*TextParseModeMarkdown) GetClass() string {
return ClassTextParseMode
}
func (*TextParseModeMarkdown) GetType() string {
return TypeTextParseModeMarkdown
}
func (*TextParseModeMarkdown) TextParseModeType() string {
return TypeTextParseModeMarkdown
}
// The text uses HTML-style formatting. The same as Telegram Bot API "HTML" parse mode
type TextParseModeHTML struct {
meta
}
func (entity *TextParseModeHTML) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TextParseModeHTML
return json.Marshal((*stub)(entity))
}
func (*TextParseModeHTML) GetClass() string {
return ClassTextParseMode
}
func (*TextParseModeHTML) GetType() string {
return TypeTextParseModeHTML
}
func (*TextParseModeHTML) TextParseModeType() string {
return TypeTextParseModeHTML
}
// A SOCKS5 proxy server
type ProxyTypeSocks5 struct {
meta
// Username for logging in; may be empty
Username string `json:"username"`
// Password for logging in; may be empty
Password string `json:"password"`
}
func (entity *ProxyTypeSocks5) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ProxyTypeSocks5
return json.Marshal((*stub)(entity))
}
func (*ProxyTypeSocks5) GetClass() string {
return ClassProxyType
}
func (*ProxyTypeSocks5) GetType() string {
return TypeProxyTypeSocks5
}
func (*ProxyTypeSocks5) ProxyTypeType() string {
return TypeProxyTypeSocks5
}
// A HTTP transparent proxy server
type ProxyTypeHttp struct {
meta
// Username for logging in; may be empty
Username string `json:"username"`
// Password for logging in; may be empty
Password string `json:"password"`
// Pass true if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method
HttpOnly bool `json:"http_only"`
}
func (entity *ProxyTypeHttp) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ProxyTypeHttp
return json.Marshal((*stub)(entity))
}
func (*ProxyTypeHttp) GetClass() string {
return ClassProxyType
}
func (*ProxyTypeHttp) GetType() string {
return TypeProxyTypeHttp
}
func (*ProxyTypeHttp) ProxyTypeType() string {
return TypeProxyTypeHttp
}
// An MTProto proxy server
type ProxyTypeMtproto struct {
meta
// The proxy's secret in hexadecimal encoding
Secret string `json:"secret"`
}
func (entity *ProxyTypeMtproto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ProxyTypeMtproto
return json.Marshal((*stub)(entity))
}
func (*ProxyTypeMtproto) GetClass() string {
return ClassProxyType
}
func (*ProxyTypeMtproto) GetType() string {
return TypeProxyTypeMtproto
}
func (*ProxyTypeMtproto) ProxyTypeType() string {
return TypeProxyTypeMtproto
}
// Contains information about a proxy server
type Proxy struct {
meta
// Unique identifier of the proxy
Id int32 `json:"id"`
// Proxy server IP address
Server string `json:"server"`
// Proxy server port
Port int32 `json:"port"`
// Point in time (Unix timestamp) when the proxy was last used; 0 if never
LastUsedDate int32 `json:"last_used_date"`
// True, if the proxy is enabled now
IsEnabled bool `json:"is_enabled"`
// Type of the proxy
Type ProxyType `json:"type"`
}
func (entity *Proxy) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Proxy
return json.Marshal((*stub)(entity))
}
func (*Proxy) GetClass() string {
return ClassProxy
}
func (*Proxy) GetType() string {
return TypeProxy
}
func (proxy *Proxy) UnmarshalJSON(data []byte) error {
var tmp struct {
Id int32 `json:"id"`
Server string `json:"server"`
Port int32 `json:"port"`
LastUsedDate int32 `json:"last_used_date"`
IsEnabled bool `json:"is_enabled"`
Type json.RawMessage `json:"type"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
proxy.Id = tmp.Id
proxy.Server = tmp.Server
proxy.Port = tmp.Port
proxy.LastUsedDate = tmp.LastUsedDate
proxy.IsEnabled = tmp.IsEnabled
fieldType, _ := UnmarshalProxyType(tmp.Type)
proxy.Type = fieldType
return nil
}
// Represents a list of proxy servers
type Proxies struct {
meta
// List of proxy servers
Proxies []*Proxy `json:"proxies"`
}
func (entity *Proxies) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Proxies
return json.Marshal((*stub)(entity))
}
func (*Proxies) GetClass() string {
return ClassProxies
}
func (*Proxies) GetType() string {
return TypeProxies
}
2023-06-04 22:58:07 +02:00
// A sticker to be added to a sticker set
type InputSticker struct {
2023-06-04 22:53:18 +02:00
meta
2023-06-04 22:58:07 +02:00
// File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
2023-06-04 22:53:18 +02:00
Sticker InputFile `json:"sticker"`
// Emojis corresponding to the sticker
Emojis string `json:"emojis"`
2023-06-04 22:58:07 +02:00
// Sticker format
Format StickerFormat `json:"format"`
// Position where the mask is placed; pass null if not specified
2023-06-04 22:53:18 +02:00
MaskPosition *MaskPosition `json:"mask_position"`
}
2023-06-04 22:58:07 +02:00
func (entity *InputSticker) MarshalJSON() ([]byte, error) {
2023-06-04 22:53:18 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub InputSticker
2023-06-04 22:53:18 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*InputSticker) GetClass() string {
2023-06-04 22:53:18 +02:00
return ClassInputSticker
}
2023-06-04 22:58:07 +02:00
func (*InputSticker) GetType() string {
return TypeInputSticker
2023-06-04 22:53:18 +02:00
}
2023-06-04 22:58:07 +02:00
func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error {
2023-06-04 22:53:18 +02:00
var tmp struct {
Sticker json.RawMessage `json:"sticker"`
Emojis string `json:"emojis"`
2023-06-04 22:58:07 +02:00
Format json.RawMessage `json:"format"`
2023-06-04 22:53:18 +02:00
MaskPosition *MaskPosition `json:"mask_position"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2023-06-04 22:58:07 +02:00
inputSticker.Emojis = tmp.Emojis
inputSticker.MaskPosition = tmp.MaskPosition
2023-06-04 22:53:18 +02:00
fieldSticker, _ := UnmarshalInputFile(tmp.Sticker)
2023-06-04 22:58:07 +02:00
inputSticker.Sticker = fieldSticker
2023-06-04 22:53:18 +02:00
2023-06-04 22:58:07 +02:00
fieldFormat, _ := UnmarshalStickerFormat(tmp.Format)
inputSticker.Format = fieldFormat
2021-10-22 16:24:12 +02:00
return nil
}
// Represents a date range
type DateRange struct {
meta
// Point in time (Unix timestamp) at which the date range begins
StartDate int32 `json:"start_date"`
// Point in time (Unix timestamp) at which the date range ends
EndDate int32 `json:"end_date"`
}
func (entity *DateRange) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DateRange
return json.Marshal((*stub)(entity))
}
func (*DateRange) GetClass() string {
return ClassDateRange
}
func (*DateRange) GetType() string {
return TypeDateRange
}
// A value with information about its recent changes
type StatisticalValue struct {
meta
// The current value
Value float64 `json:"value"`
// The value for the previous day
PreviousValue float64 `json:"previous_value"`
// The growth rate of the value, as a percentage
GrowthRatePercentage float64 `json:"growth_rate_percentage"`
}
func (entity *StatisticalValue) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StatisticalValue
return json.Marshal((*stub)(entity))
}
func (*StatisticalValue) GetClass() string {
return ClassStatisticalValue
}
func (*StatisticalValue) GetType() string {
return TypeStatisticalValue
}
// A graph data
type StatisticalGraphData struct {
meta
// Graph data in JSON format
JsonData string `json:"json_data"`
// If non-empty, a token which can be used to receive a zoomed in graph
ZoomToken string `json:"zoom_token"`
}
func (entity *StatisticalGraphData) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StatisticalGraphData
return json.Marshal((*stub)(entity))
}
func (*StatisticalGraphData) GetClass() string {
return ClassStatisticalGraph
}
func (*StatisticalGraphData) GetType() string {
return TypeStatisticalGraphData
}
func (*StatisticalGraphData) StatisticalGraphType() string {
return TypeStatisticalGraphData
}
// The graph data to be asynchronously loaded through getStatisticalGraph
type StatisticalGraphAsync struct {
meta
// The token to use for data loading
Token string `json:"token"`
}
func (entity *StatisticalGraphAsync) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StatisticalGraphAsync
return json.Marshal((*stub)(entity))
}
func (*StatisticalGraphAsync) GetClass() string {
return ClassStatisticalGraph
}
func (*StatisticalGraphAsync) GetType() string {
return TypeStatisticalGraphAsync
}
func (*StatisticalGraphAsync) StatisticalGraphType() string {
return TypeStatisticalGraphAsync
}
// An error message to be shown to the user instead of the graph
type StatisticalGraphError struct {
meta
// The error message
ErrorMessage string `json:"error_message"`
}
func (entity *StatisticalGraphError) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StatisticalGraphError
return json.Marshal((*stub)(entity))
}
func (*StatisticalGraphError) GetClass() string {
return ClassStatisticalGraph
}
func (*StatisticalGraphError) GetType() string {
return TypeStatisticalGraphError
}
func (*StatisticalGraphError) StatisticalGraphType() string {
return TypeStatisticalGraphError
}
// Contains statistics about interactions with a message
type ChatStatisticsMessageInteractionInfo struct {
meta
// Message identifier
MessageId int64 `json:"message_id"`
// Number of times the message was viewed
ViewCount int32 `json:"view_count"`
// Number of times the message was forwarded
ForwardCount int32 `json:"forward_count"`
}
func (entity *ChatStatisticsMessageInteractionInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatStatisticsMessageInteractionInfo
return json.Marshal((*stub)(entity))
}
func (*ChatStatisticsMessageInteractionInfo) GetClass() string {
return ClassChatStatisticsMessageInteractionInfo
}
func (*ChatStatisticsMessageInteractionInfo) GetType() string {
return TypeChatStatisticsMessageInteractionInfo
}
// Contains statistics about messages sent by a user
type ChatStatisticsMessageSenderInfo struct {
meta
// User identifier
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
// Number of sent messages
SentMessageCount int32 `json:"sent_message_count"`
2021-12-08 10:23:00 +01:00
// Average number of characters in sent messages; 0 if unknown
2021-10-22 16:24:12 +02:00
AverageCharacterCount int32 `json:"average_character_count"`
}
func (entity *ChatStatisticsMessageSenderInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatStatisticsMessageSenderInfo
return json.Marshal((*stub)(entity))
}
func (*ChatStatisticsMessageSenderInfo) GetClass() string {
return ClassChatStatisticsMessageSenderInfo
}
func (*ChatStatisticsMessageSenderInfo) GetType() string {
return TypeChatStatisticsMessageSenderInfo
}
// Contains statistics about administrator actions done by a user
type ChatStatisticsAdministratorActionsInfo struct {
meta
// Administrator user identifier
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
// Number of messages deleted by the administrator
DeletedMessageCount int32 `json:"deleted_message_count"`
// Number of users banned by the administrator
BannedUserCount int32 `json:"banned_user_count"`
// Number of users restricted by the administrator
RestrictedUserCount int32 `json:"restricted_user_count"`
}
func (entity *ChatStatisticsAdministratorActionsInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatStatisticsAdministratorActionsInfo
return json.Marshal((*stub)(entity))
}
func (*ChatStatisticsAdministratorActionsInfo) GetClass() string {
return ClassChatStatisticsAdministratorActionsInfo
}
func (*ChatStatisticsAdministratorActionsInfo) GetType() string {
return TypeChatStatisticsAdministratorActionsInfo
}
// Contains statistics about number of new members invited by a user
type ChatStatisticsInviterInfo struct {
meta
// User identifier
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
// Number of new members invited by the user
AddedMemberCount int32 `json:"added_member_count"`
}
func (entity *ChatStatisticsInviterInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatStatisticsInviterInfo
return json.Marshal((*stub)(entity))
}
func (*ChatStatisticsInviterInfo) GetClass() string {
return ClassChatStatisticsInviterInfo
}
func (*ChatStatisticsInviterInfo) GetType() string {
return TypeChatStatisticsInviterInfo
}
// A detailed statistics about a supergroup chat
type ChatStatisticsSupergroup struct {
meta
// A period to which the statistics applies
Period *DateRange `json:"period"`
// Number of members in the chat
MemberCount *StatisticalValue `json:"member_count"`
// Number of messages sent to the chat
MessageCount *StatisticalValue `json:"message_count"`
// Number of users who viewed messages in the chat
ViewerCount *StatisticalValue `json:"viewer_count"`
// Number of users who sent messages to the chat
SenderCount *StatisticalValue `json:"sender_count"`
// A graph containing number of members in the chat
MemberCountGraph StatisticalGraph `json:"member_count_graph"`
// A graph containing number of members joined and left the chat
JoinGraph StatisticalGraph `json:"join_graph"`
// A graph containing number of new member joins per source
JoinBySourceGraph StatisticalGraph `json:"join_by_source_graph"`
// A graph containing distribution of active users per language
LanguageGraph StatisticalGraph `json:"language_graph"`
// A graph containing distribution of sent messages by content type
MessageContentGraph StatisticalGraph `json:"message_content_graph"`
// A graph containing number of different actions in the chat
ActionGraph StatisticalGraph `json:"action_graph"`
// A graph containing distribution of message views per hour
DayGraph StatisticalGraph `json:"day_graph"`
// A graph containing distribution of message views per day of week
WeekGraph StatisticalGraph `json:"week_graph"`
// List of users sent most messages in the last week
TopSenders []*ChatStatisticsMessageSenderInfo `json:"top_senders"`
// List of most active administrators in the last week
TopAdministrators []*ChatStatisticsAdministratorActionsInfo `json:"top_administrators"`
// List of most active inviters of new members in the last week
TopInviters []*ChatStatisticsInviterInfo `json:"top_inviters"`
}
func (entity *ChatStatisticsSupergroup) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatStatisticsSupergroup
return json.Marshal((*stub)(entity))
}
func (*ChatStatisticsSupergroup) GetClass() string {
return ClassChatStatistics
}
func (*ChatStatisticsSupergroup) GetType() string {
return TypeChatStatisticsSupergroup
}
func (*ChatStatisticsSupergroup) ChatStatisticsType() string {
return TypeChatStatisticsSupergroup
}
func (chatStatisticsSupergroup *ChatStatisticsSupergroup) UnmarshalJSON(data []byte) error {
var tmp struct {
Period *DateRange `json:"period"`
MemberCount *StatisticalValue `json:"member_count"`
MessageCount *StatisticalValue `json:"message_count"`
ViewerCount *StatisticalValue `json:"viewer_count"`
SenderCount *StatisticalValue `json:"sender_count"`
MemberCountGraph json.RawMessage `json:"member_count_graph"`
JoinGraph json.RawMessage `json:"join_graph"`
JoinBySourceGraph json.RawMessage `json:"join_by_source_graph"`
LanguageGraph json.RawMessage `json:"language_graph"`
MessageContentGraph json.RawMessage `json:"message_content_graph"`
ActionGraph json.RawMessage `json:"action_graph"`
DayGraph json.RawMessage `json:"day_graph"`
WeekGraph json.RawMessage `json:"week_graph"`
TopSenders []*ChatStatisticsMessageSenderInfo `json:"top_senders"`
TopAdministrators []*ChatStatisticsAdministratorActionsInfo `json:"top_administrators"`
TopInviters []*ChatStatisticsInviterInfo `json:"top_inviters"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chatStatisticsSupergroup.Period = tmp.Period
chatStatisticsSupergroup.MemberCount = tmp.MemberCount
chatStatisticsSupergroup.MessageCount = tmp.MessageCount
chatStatisticsSupergroup.ViewerCount = tmp.ViewerCount
chatStatisticsSupergroup.SenderCount = tmp.SenderCount
chatStatisticsSupergroup.TopSenders = tmp.TopSenders
chatStatisticsSupergroup.TopAdministrators = tmp.TopAdministrators
chatStatisticsSupergroup.TopInviters = tmp.TopInviters
fieldMemberCountGraph, _ := UnmarshalStatisticalGraph(tmp.MemberCountGraph)
chatStatisticsSupergroup.MemberCountGraph = fieldMemberCountGraph
fieldJoinGraph, _ := UnmarshalStatisticalGraph(tmp.JoinGraph)
chatStatisticsSupergroup.JoinGraph = fieldJoinGraph
fieldJoinBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.JoinBySourceGraph)
chatStatisticsSupergroup.JoinBySourceGraph = fieldJoinBySourceGraph
fieldLanguageGraph, _ := UnmarshalStatisticalGraph(tmp.LanguageGraph)
chatStatisticsSupergroup.LanguageGraph = fieldLanguageGraph
fieldMessageContentGraph, _ := UnmarshalStatisticalGraph(tmp.MessageContentGraph)
chatStatisticsSupergroup.MessageContentGraph = fieldMessageContentGraph
fieldActionGraph, _ := UnmarshalStatisticalGraph(tmp.ActionGraph)
chatStatisticsSupergroup.ActionGraph = fieldActionGraph
fieldDayGraph, _ := UnmarshalStatisticalGraph(tmp.DayGraph)
chatStatisticsSupergroup.DayGraph = fieldDayGraph
fieldWeekGraph, _ := UnmarshalStatisticalGraph(tmp.WeekGraph)
chatStatisticsSupergroup.WeekGraph = fieldWeekGraph
return nil
}
// A detailed statistics about a channel chat
type ChatStatisticsChannel struct {
meta
// A period to which the statistics applies
Period *DateRange `json:"period"`
// Number of members in the chat
MemberCount *StatisticalValue `json:"member_count"`
// Mean number of times the recently sent messages was viewed
MeanViewCount *StatisticalValue `json:"mean_view_count"`
// Mean number of times the recently sent messages was shared
MeanShareCount *StatisticalValue `json:"mean_share_count"`
// A percentage of users with enabled notifications for the chat
EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"`
// A graph containing number of members in the chat
MemberCountGraph StatisticalGraph `json:"member_count_graph"`
// A graph containing number of members joined and left the chat
JoinGraph StatisticalGraph `json:"join_graph"`
// A graph containing number of members muted and unmuted the chat
MuteGraph StatisticalGraph `json:"mute_graph"`
// A graph containing number of message views in a given hour in the last two weeks
ViewCountByHourGraph StatisticalGraph `json:"view_count_by_hour_graph"`
// A graph containing number of message views per source
ViewCountBySourceGraph StatisticalGraph `json:"view_count_by_source_graph"`
// A graph containing number of new member joins per source
JoinBySourceGraph StatisticalGraph `json:"join_by_source_graph"`
// A graph containing number of users viewed chat messages per language
LanguageGraph StatisticalGraph `json:"language_graph"`
// A graph containing number of chat message views and shares
MessageInteractionGraph StatisticalGraph `json:"message_interaction_graph"`
// A graph containing number of views of associated with the chat instant views
InstantViewInteractionGraph StatisticalGraph `json:"instant_view_interaction_graph"`
// Detailed statistics about number of views and shares of recently sent messages
RecentMessageInteractions []*ChatStatisticsMessageInteractionInfo `json:"recent_message_interactions"`
}
func (entity *ChatStatisticsChannel) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatStatisticsChannel
return json.Marshal((*stub)(entity))
}
func (*ChatStatisticsChannel) GetClass() string {
return ClassChatStatistics
}
func (*ChatStatisticsChannel) GetType() string {
return TypeChatStatisticsChannel
}
func (*ChatStatisticsChannel) ChatStatisticsType() string {
return TypeChatStatisticsChannel
}
func (chatStatisticsChannel *ChatStatisticsChannel) UnmarshalJSON(data []byte) error {
var tmp struct {
Period *DateRange `json:"period"`
MemberCount *StatisticalValue `json:"member_count"`
MeanViewCount *StatisticalValue `json:"mean_view_count"`
MeanShareCount *StatisticalValue `json:"mean_share_count"`
EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"`
MemberCountGraph json.RawMessage `json:"member_count_graph"`
JoinGraph json.RawMessage `json:"join_graph"`
MuteGraph json.RawMessage `json:"mute_graph"`
ViewCountByHourGraph json.RawMessage `json:"view_count_by_hour_graph"`
ViewCountBySourceGraph json.RawMessage `json:"view_count_by_source_graph"`
JoinBySourceGraph json.RawMessage `json:"join_by_source_graph"`
LanguageGraph json.RawMessage `json:"language_graph"`
MessageInteractionGraph json.RawMessage `json:"message_interaction_graph"`
InstantViewInteractionGraph json.RawMessage `json:"instant_view_interaction_graph"`
RecentMessageInteractions []*ChatStatisticsMessageInteractionInfo `json:"recent_message_interactions"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
chatStatisticsChannel.Period = tmp.Period
chatStatisticsChannel.MemberCount = tmp.MemberCount
chatStatisticsChannel.MeanViewCount = tmp.MeanViewCount
chatStatisticsChannel.MeanShareCount = tmp.MeanShareCount
chatStatisticsChannel.EnabledNotificationsPercentage = tmp.EnabledNotificationsPercentage
chatStatisticsChannel.RecentMessageInteractions = tmp.RecentMessageInteractions
fieldMemberCountGraph, _ := UnmarshalStatisticalGraph(tmp.MemberCountGraph)
chatStatisticsChannel.MemberCountGraph = fieldMemberCountGraph
fieldJoinGraph, _ := UnmarshalStatisticalGraph(tmp.JoinGraph)
chatStatisticsChannel.JoinGraph = fieldJoinGraph
fieldMuteGraph, _ := UnmarshalStatisticalGraph(tmp.MuteGraph)
chatStatisticsChannel.MuteGraph = fieldMuteGraph
fieldViewCountByHourGraph, _ := UnmarshalStatisticalGraph(tmp.ViewCountByHourGraph)
chatStatisticsChannel.ViewCountByHourGraph = fieldViewCountByHourGraph
fieldViewCountBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.ViewCountBySourceGraph)
chatStatisticsChannel.ViewCountBySourceGraph = fieldViewCountBySourceGraph
fieldJoinBySourceGraph, _ := UnmarshalStatisticalGraph(tmp.JoinBySourceGraph)
chatStatisticsChannel.JoinBySourceGraph = fieldJoinBySourceGraph
fieldLanguageGraph, _ := UnmarshalStatisticalGraph(tmp.LanguageGraph)
chatStatisticsChannel.LanguageGraph = fieldLanguageGraph
fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph)
chatStatisticsChannel.MessageInteractionGraph = fieldMessageInteractionGraph
fieldInstantViewInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.InstantViewInteractionGraph)
chatStatisticsChannel.InstantViewInteractionGraph = fieldInstantViewInteractionGraph
return nil
}
// A detailed statistics about a message
type MessageStatistics struct {
meta
// A graph containing number of message views and shares
MessageInteractionGraph StatisticalGraph `json:"message_interaction_graph"`
}
func (entity *MessageStatistics) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageStatistics
return json.Marshal((*stub)(entity))
}
func (*MessageStatistics) GetClass() string {
return ClassMessageStatistics
}
func (*MessageStatistics) GetType() string {
return TypeMessageStatistics
}
func (messageStatistics *MessageStatistics) UnmarshalJSON(data []byte) error {
var tmp struct {
MessageInteractionGraph json.RawMessage `json:"message_interaction_graph"`
}
2021-12-08 10:23:00 +01:00
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldMessageInteractionGraph, _ := UnmarshalStatisticalGraph(tmp.MessageInteractionGraph)
messageStatistics.MessageInteractionGraph = fieldMessageInteractionGraph
return nil
}
// A point on a Cartesian plane
type Point struct {
meta
// The point's first coordinate
X float64 `json:"x"`
// The point's second coordinate
Y float64 `json:"y"`
}
func (entity *Point) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Point
return json.Marshal((*stub)(entity))
}
func (*Point) GetClass() string {
return ClassPoint
}
func (*Point) GetType() string {
return TypePoint
}
// A straight line to a given point
type VectorPathCommandLine struct {
meta
// The end point of the straight line
EndPoint *Point `json:"end_point"`
}
func (entity *VectorPathCommandLine) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub VectorPathCommandLine
return json.Marshal((*stub)(entity))
}
func (*VectorPathCommandLine) GetClass() string {
return ClassVectorPathCommand
}
func (*VectorPathCommandLine) GetType() string {
return TypeVectorPathCommandLine
}
func (*VectorPathCommandLine) VectorPathCommandType() string {
return TypeVectorPathCommandLine
}
// A cubic Bézier curve to a given point
type VectorPathCommandCubicBezierCurve struct {
meta
// The start control point of the curve
StartControlPoint *Point `json:"start_control_point"`
// The end control point of the curve
EndControlPoint *Point `json:"end_control_point"`
// The end point of the curve
EndPoint *Point `json:"end_point"`
}
func (entity *VectorPathCommandCubicBezierCurve) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub VectorPathCommandCubicBezierCurve
return json.Marshal((*stub)(entity))
}
func (*VectorPathCommandCubicBezierCurve) GetClass() string {
return ClassVectorPathCommand
}
func (*VectorPathCommandCubicBezierCurve) GetType() string {
return TypeVectorPathCommandCubicBezierCurve
}
func (*VectorPathCommandCubicBezierCurve) VectorPathCommandType() string {
return TypeVectorPathCommandCubicBezierCurve
}
// A scope covering all users
type BotCommandScopeDefault struct {
meta
}
func (entity *BotCommandScopeDefault) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BotCommandScopeDefault
return json.Marshal((*stub)(entity))
}
func (*BotCommandScopeDefault) GetClass() string {
return ClassBotCommandScope
}
func (*BotCommandScopeDefault) GetType() string {
return TypeBotCommandScopeDefault
}
func (*BotCommandScopeDefault) BotCommandScopeType() string {
return TypeBotCommandScopeDefault
}
// A scope covering all private chats
type BotCommandScopeAllPrivateChats struct {
meta
}
func (entity *BotCommandScopeAllPrivateChats) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BotCommandScopeAllPrivateChats
return json.Marshal((*stub)(entity))
}
func (*BotCommandScopeAllPrivateChats) GetClass() string {
return ClassBotCommandScope
}
func (*BotCommandScopeAllPrivateChats) GetType() string {
return TypeBotCommandScopeAllPrivateChats
}
func (*BotCommandScopeAllPrivateChats) BotCommandScopeType() string {
return TypeBotCommandScopeAllPrivateChats
}
// A scope covering all group and supergroup chats
type BotCommandScopeAllGroupChats struct {
meta
}
func (entity *BotCommandScopeAllGroupChats) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BotCommandScopeAllGroupChats
return json.Marshal((*stub)(entity))
}
func (*BotCommandScopeAllGroupChats) GetClass() string {
return ClassBotCommandScope
}
func (*BotCommandScopeAllGroupChats) GetType() string {
return TypeBotCommandScopeAllGroupChats
}
func (*BotCommandScopeAllGroupChats) BotCommandScopeType() string {
return TypeBotCommandScopeAllGroupChats
}
// A scope covering all group and supergroup chat administrators
type BotCommandScopeAllChatAdministrators struct {
meta
}
func (entity *BotCommandScopeAllChatAdministrators) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BotCommandScopeAllChatAdministrators
return json.Marshal((*stub)(entity))
}
func (*BotCommandScopeAllChatAdministrators) GetClass() string {
return ClassBotCommandScope
}
func (*BotCommandScopeAllChatAdministrators) GetType() string {
return TypeBotCommandScopeAllChatAdministrators
}
func (*BotCommandScopeAllChatAdministrators) BotCommandScopeType() string {
return TypeBotCommandScopeAllChatAdministrators
}
// A scope covering all members of a chat
type BotCommandScopeChat struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
}
func (entity *BotCommandScopeChat) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BotCommandScopeChat
return json.Marshal((*stub)(entity))
}
func (*BotCommandScopeChat) GetClass() string {
return ClassBotCommandScope
}
func (*BotCommandScopeChat) GetType() string {
return TypeBotCommandScopeChat
}
func (*BotCommandScopeChat) BotCommandScopeType() string {
return TypeBotCommandScopeChat
}
// A scope covering all administrators of a chat
type BotCommandScopeChatAdministrators struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
}
func (entity *BotCommandScopeChatAdministrators) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BotCommandScopeChatAdministrators
return json.Marshal((*stub)(entity))
}
func (*BotCommandScopeChatAdministrators) GetClass() string {
return ClassBotCommandScope
}
func (*BotCommandScopeChatAdministrators) GetType() string {
return TypeBotCommandScopeChatAdministrators
}
func (*BotCommandScopeChatAdministrators) BotCommandScopeType() string {
return TypeBotCommandScopeChatAdministrators
}
// A scope covering a member of a chat
type BotCommandScopeChatMember struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// User identifier
UserId int64 `json:"user_id"`
}
func (entity *BotCommandScopeChatMember) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub BotCommandScopeChatMember
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2021-10-22 16:24:12 +02:00
2021-12-08 10:23:00 +01:00
func (*BotCommandScopeChatMember) GetClass() string {
return ClassBotCommandScope
}
func (*BotCommandScopeChatMember) GetType() string {
return TypeBotCommandScopeChatMember
}
func (*BotCommandScopeChatMember) BotCommandScopeType() string {
return TypeBotCommandScopeChatMember
2021-10-22 16:24:12 +02:00
}
// The user authorization state has changed
type UpdateAuthorizationState struct {
meta
// New authorization state
AuthorizationState AuthorizationState `json:"authorization_state"`
}
func (entity *UpdateAuthorizationState) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateAuthorizationState
return json.Marshal((*stub)(entity))
}
func (*UpdateAuthorizationState) GetClass() string {
return ClassUpdate
}
func (*UpdateAuthorizationState) GetType() string {
return TypeUpdateAuthorizationState
}
func (*UpdateAuthorizationState) UpdateType() string {
return TypeUpdateAuthorizationState
}
func (updateAuthorizationState *UpdateAuthorizationState) UnmarshalJSON(data []byte) error {
var tmp struct {
AuthorizationState json.RawMessage `json:"authorization_state"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldAuthorizationState, _ := UnmarshalAuthorizationState(tmp.AuthorizationState)
updateAuthorizationState.AuthorizationState = fieldAuthorizationState
return nil
}
// A new message was received; can also be an outgoing message
type UpdateNewMessage struct {
meta
// The new message
Message *Message `json:"message"`
}
func (entity *UpdateNewMessage) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewMessage
return json.Marshal((*stub)(entity))
}
func (*UpdateNewMessage) GetClass() string {
return ClassUpdate
}
func (*UpdateNewMessage) GetType() string {
return TypeUpdateNewMessage
}
func (*UpdateNewMessage) UpdateType() string {
return TypeUpdateNewMessage
}
// A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed. This update will be sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message
type UpdateMessageSendAcknowledged struct {
meta
// The chat identifier of the sent message
ChatId int64 `json:"chat_id"`
// A temporary message identifier
MessageId int64 `json:"message_id"`
}
func (entity *UpdateMessageSendAcknowledged) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateMessageSendAcknowledged
return json.Marshal((*stub)(entity))
}
func (*UpdateMessageSendAcknowledged) GetClass() string {
return ClassUpdate
}
func (*UpdateMessageSendAcknowledged) GetType() string {
return TypeUpdateMessageSendAcknowledged
}
func (*UpdateMessageSendAcknowledged) UpdateType() string {
return TypeUpdateMessageSendAcknowledged
}
// A message has been successfully sent
type UpdateMessageSendSucceeded struct {
meta
2021-12-08 10:23:00 +01:00
// The sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change
2021-10-22 16:24:12 +02:00
Message *Message `json:"message"`
// The previous temporary message identifier
OldMessageId int64 `json:"old_message_id"`
}
func (entity *UpdateMessageSendSucceeded) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateMessageSendSucceeded
return json.Marshal((*stub)(entity))
}
func (*UpdateMessageSendSucceeded) GetClass() string {
return ClassUpdate
}
func (*UpdateMessageSendSucceeded) GetType() string {
return TypeUpdateMessageSendSucceeded
}
func (*UpdateMessageSendSucceeded) UpdateType() string {
return TypeUpdateMessageSendSucceeded
}
// A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update
type UpdateMessageSendFailed struct {
meta
2021-12-08 10:23:00 +01:00
// The failed to send message
2021-10-22 16:24:12 +02:00
Message *Message `json:"message"`
// The previous temporary message identifier
OldMessageId int64 `json:"old_message_id"`
// An error code
ErrorCode int32 `json:"error_code"`
// Error message
ErrorMessage string `json:"error_message"`
}
func (entity *UpdateMessageSendFailed) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateMessageSendFailed
return json.Marshal((*stub)(entity))
}
func (*UpdateMessageSendFailed) GetClass() string {
return ClassUpdate
}
func (*UpdateMessageSendFailed) GetType() string {
return TypeUpdateMessageSendFailed
}
func (*UpdateMessageSendFailed) UpdateType() string {
return TypeUpdateMessageSendFailed
}
// The message content has changed
type UpdateMessageContent struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// New message content
NewContent MessageContent `json:"new_content"`
}
func (entity *UpdateMessageContent) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateMessageContent
return json.Marshal((*stub)(entity))
}
func (*UpdateMessageContent) GetClass() string {
return ClassUpdate
}
func (*UpdateMessageContent) GetType() string {
return TypeUpdateMessageContent
}
func (*UpdateMessageContent) UpdateType() string {
return TypeUpdateMessageContent
}
func (updateMessageContent *UpdateMessageContent) UnmarshalJSON(data []byte) error {
var tmp struct {
ChatId int64 `json:"chat_id"`
MessageId int64 `json:"message_id"`
NewContent json.RawMessage `json:"new_content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateMessageContent.ChatId = tmp.ChatId
updateMessageContent.MessageId = tmp.MessageId
fieldNewContent, _ := UnmarshalMessageContent(tmp.NewContent)
updateMessageContent.NewContent = fieldNewContent
return nil
}
// A message was edited. Changes in the message content will come in a separate updateMessageContent
type UpdateMessageEdited struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// Point in time (Unix timestamp) when the message was edited
EditDate int32 `json:"edit_date"`
// New message reply markup; may be null
ReplyMarkup ReplyMarkup `json:"reply_markup"`
}
func (entity *UpdateMessageEdited) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateMessageEdited
return json.Marshal((*stub)(entity))
}
func (*UpdateMessageEdited) GetClass() string {
return ClassUpdate
}
func (*UpdateMessageEdited) GetType() string {
return TypeUpdateMessageEdited
}
func (*UpdateMessageEdited) UpdateType() string {
return TypeUpdateMessageEdited
}
func (updateMessageEdited *UpdateMessageEdited) UnmarshalJSON(data []byte) error {
var tmp struct {
ChatId int64 `json:"chat_id"`
MessageId int64 `json:"message_id"`
EditDate int32 `json:"edit_date"`
ReplyMarkup json.RawMessage `json:"reply_markup"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateMessageEdited.ChatId = tmp.ChatId
updateMessageEdited.MessageId = tmp.MessageId
updateMessageEdited.EditDate = tmp.EditDate
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
updateMessageEdited.ReplyMarkup = fieldReplyMarkup
return nil
}
// The message pinned state was changed
type UpdateMessageIsPinned struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The message identifier
MessageId int64 `json:"message_id"`
// True, if the message is pinned
IsPinned bool `json:"is_pinned"`
}
func (entity *UpdateMessageIsPinned) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateMessageIsPinned
return json.Marshal((*stub)(entity))
}
func (*UpdateMessageIsPinned) GetClass() string {
return ClassUpdate
}
func (*UpdateMessageIsPinned) GetType() string {
return TypeUpdateMessageIsPinned
}
func (*UpdateMessageIsPinned) UpdateType() string {
return TypeUpdateMessageIsPinned
}
// The information about interactions with a message has changed
type UpdateMessageInteractionInfo struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// New information about interactions with the message; may be null
InteractionInfo *MessageInteractionInfo `json:"interaction_info"`
}
func (entity *UpdateMessageInteractionInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateMessageInteractionInfo
return json.Marshal((*stub)(entity))
}
func (*UpdateMessageInteractionInfo) GetClass() string {
return ClassUpdate
}
func (*UpdateMessageInteractionInfo) GetType() string {
return TypeUpdateMessageInteractionInfo
}
func (*UpdateMessageInteractionInfo) UpdateType() string {
return TypeUpdateMessageInteractionInfo
}
2023-06-04 22:58:07 +02:00
// The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the self-destruct timer
2021-10-22 16:24:12 +02:00
type UpdateMessageContentOpened struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
}
func (entity *UpdateMessageContentOpened) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateMessageContentOpened
return json.Marshal((*stub)(entity))
}
func (*UpdateMessageContentOpened) GetClass() string {
return ClassUpdate
}
func (*UpdateMessageContentOpened) GetType() string {
return TypeUpdateMessageContentOpened
}
func (*UpdateMessageContentOpened) UpdateType() string {
return TypeUpdateMessageContentOpened
}
// A message with an unread mention was read
type UpdateMessageMentionRead struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// The new number of unread mention messages left in the chat
UnreadMentionCount int32 `json:"unread_mention_count"`
}
func (entity *UpdateMessageMentionRead) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateMessageMentionRead
return json.Marshal((*stub)(entity))
}
func (*UpdateMessageMentionRead) GetClass() string {
return ClassUpdate
}
func (*UpdateMessageMentionRead) GetType() string {
return TypeUpdateMessageMentionRead
}
func (*UpdateMessageMentionRead) UpdateType() string {
return TypeUpdateMessageMentionRead
}
2023-06-04 22:58:07 +02:00
// The list of unread reactions added to a message was changed
type UpdateMessageUnreadReactions struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// The new list of unread reactions
UnreadReactions []*UnreadReaction `json:"unread_reactions"`
// The new number of messages with unread reactions left in the chat
UnreadReactionCount int32 `json:"unread_reaction_count"`
}
func (entity *UpdateMessageUnreadReactions) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateMessageUnreadReactions
return json.Marshal((*stub)(entity))
}
func (*UpdateMessageUnreadReactions) GetClass() string {
return ClassUpdate
}
func (*UpdateMessageUnreadReactions) GetType() string {
return TypeUpdateMessageUnreadReactions
}
func (*UpdateMessageUnreadReactions) UpdateType() string {
return TypeUpdateMessageUnreadReactions
}
2021-10-22 16:24:12 +02:00
// A message with a live location was viewed. When the update is received, the application is supposed to update the live location
type UpdateMessageLiveLocationViewed struct {
meta
// Identifier of the chat with the live location message
ChatId int64 `json:"chat_id"`
// Identifier of the message with live location
MessageId int64 `json:"message_id"`
}
func (entity *UpdateMessageLiveLocationViewed) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateMessageLiveLocationViewed
return json.Marshal((*stub)(entity))
}
func (*UpdateMessageLiveLocationViewed) GetClass() string {
return ClassUpdate
}
func (*UpdateMessageLiveLocationViewed) GetType() string {
return TypeUpdateMessageLiveLocationViewed
}
func (*UpdateMessageLiveLocationViewed) UpdateType() string {
return TypeUpdateMessageLiveLocationViewed
}
// 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
// The chat
Chat *Chat `json:"chat"`
}
func (entity *UpdateNewChat) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewChat
return json.Marshal((*stub)(entity))
}
func (*UpdateNewChat) GetClass() string {
return ClassUpdate
}
func (*UpdateNewChat) GetType() string {
return TypeUpdateNewChat
}
func (*UpdateNewChat) UpdateType() string {
return TypeUpdateNewChat
}
// The title of a chat was changed
type UpdateChatTitle struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new chat title
Title string `json:"title"`
}
func (entity *UpdateChatTitle) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatTitle
return json.Marshal((*stub)(entity))
}
func (*UpdateChatTitle) GetClass() string {
return ClassUpdate
}
func (*UpdateChatTitle) GetType() string {
return TypeUpdateChatTitle
}
func (*UpdateChatTitle) UpdateType() string {
return TypeUpdateChatTitle
}
// A chat photo was changed
type UpdateChatPhoto struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new chat photo; may be null
Photo *ChatPhotoInfo `json:"photo"`
}
func (entity *UpdateChatPhoto) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatPhoto
return json.Marshal((*stub)(entity))
}
func (*UpdateChatPhoto) GetClass() string {
return ClassUpdate
}
func (*UpdateChatPhoto) GetType() string {
return TypeUpdateChatPhoto
}
func (*UpdateChatPhoto) UpdateType() string {
return TypeUpdateChatPhoto
}
// Chat permissions was changed
type UpdateChatPermissions struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new chat permissions
Permissions *ChatPermissions `json:"permissions"`
}
func (entity *UpdateChatPermissions) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatPermissions
return json.Marshal((*stub)(entity))
}
func (*UpdateChatPermissions) GetClass() string {
return ClassUpdate
}
func (*UpdateChatPermissions) GetType() string {
return TypeUpdateChatPermissions
}
func (*UpdateChatPermissions) UpdateType() string {
return TypeUpdateChatPermissions
}
// The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case
type UpdateChatLastMessage struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new last message in the chat; may be null
LastMessage *Message `json:"last_message"`
// The new chat positions in the chat lists
Positions []*ChatPosition `json:"positions"`
}
func (entity *UpdateChatLastMessage) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatLastMessage
return json.Marshal((*stub)(entity))
}
func (*UpdateChatLastMessage) GetClass() string {
return ClassUpdate
}
func (*UpdateChatLastMessage) GetType() string {
return TypeUpdateChatLastMessage
}
func (*UpdateChatLastMessage) UpdateType() string {
return TypeUpdateChatLastMessage
}
// The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent
type UpdateChatPosition struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// New chat position. If new order is 0, then the chat needs to be removed from the list
Position *ChatPosition `json:"position"`
}
func (entity *UpdateChatPosition) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatPosition
return json.Marshal((*stub)(entity))
}
func (*UpdateChatPosition) GetClass() string {
return ClassUpdate
}
func (*UpdateChatPosition) GetType() string {
return TypeUpdateChatPosition
}
func (*UpdateChatPosition) UpdateType() string {
return TypeUpdateChatPosition
}
2022-04-18 22:45:01 +02:00
// Incoming messages were read or the number of unread messages has been changed
type UpdateChatReadInbox struct {
2021-12-08 10:23:00 +01:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// Identifier of the last read incoming message
LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"`
// The number of unread messages left in the chat
UnreadCount int32 `json:"unread_count"`
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatReadInbox) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatReadInbox
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatReadInbox) GetClass() string {
return ClassUpdate
}
func (*UpdateChatReadInbox) GetType() string {
return TypeUpdateChatReadInbox
}
func (*UpdateChatReadInbox) UpdateType() string {
return TypeUpdateChatReadInbox
}
// Outgoing messages were read
type UpdateChatReadOutbox struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of last read outgoing message
LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"`
}
func (entity *UpdateChatReadOutbox) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatReadOutbox
return json.Marshal((*stub)(entity))
}
func (*UpdateChatReadOutbox) GetClass() string {
return ClassUpdate
}
func (*UpdateChatReadOutbox) GetType() string {
return TypeUpdateChatReadOutbox
}
func (*UpdateChatReadOutbox) UpdateType() string {
return TypeUpdateChatReadOutbox
}
2023-06-04 22:58:07 +02:00
// The chat action bar was changed
type UpdateChatActionBar struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The new value of the action bar; may be null
ActionBar ChatActionBar `json:"action_bar"`
}
func (entity *UpdateChatActionBar) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatActionBar
return json.Marshal((*stub)(entity))
}
func (*UpdateChatActionBar) GetClass() string {
return ClassUpdate
}
func (*UpdateChatActionBar) GetType() string {
return TypeUpdateChatActionBar
}
func (*UpdateChatActionBar) UpdateType() string {
return TypeUpdateChatActionBar
}
func (updateChatActionBar *UpdateChatActionBar) UnmarshalJSON(data []byte) error {
var tmp struct {
ChatId int64 `json:"chat_id"`
ActionBar json.RawMessage `json:"action_bar"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateChatActionBar.ChatId = tmp.ChatId
fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar)
updateChatActionBar.ActionBar = fieldActionBar
return nil
}
// The chat available reactions were changed
type UpdateChatAvailableReactions struct {
2022-04-18 22:45:01 +02:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2023-06-04 22:58:07 +02:00
// The new reactions, available in the chat
AvailableReactions ChatAvailableReactions `json:"available_reactions"`
2022-04-18 22:45:01 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *UpdateChatAvailableReactions) MarshalJSON() ([]byte, error) {
2022-04-18 22:45:01 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UpdateChatAvailableReactions
2022-04-18 22:45:01 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UpdateChatAvailableReactions) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassUpdate
}
2023-06-04 22:58:07 +02:00
func (*UpdateChatAvailableReactions) GetType() string {
return TypeUpdateChatAvailableReactions
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (*UpdateChatAvailableReactions) UpdateType() string {
return TypeUpdateChatAvailableReactions
2021-12-08 10:23:00 +01:00
}
2023-06-04 22:58:07 +02:00
func (updateChatAvailableReactions *UpdateChatAvailableReactions) UnmarshalJSON(data []byte) error {
2021-12-08 10:23:00 +01:00
var tmp struct {
2023-06-04 22:58:07 +02:00
ChatId int64 `json:"chat_id"`
AvailableReactions json.RawMessage `json:"available_reactions"`
2021-12-08 10:23:00 +01:00
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2023-06-04 22:58:07 +02:00
updateChatAvailableReactions.ChatId = tmp.ChatId
2021-12-08 10:23:00 +01:00
2023-06-04 22:58:07 +02:00
fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions)
updateChatAvailableReactions.AvailableReactions = fieldAvailableReactions
2021-12-08 10:23:00 +01:00
return nil
}
2022-04-18 22:45:01 +02:00
// A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied
type UpdateChatDraftMessage struct {
2021-10-22 16:24:12 +02:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// The new draft message; may be null
DraftMessage *DraftMessage `json:"draft_message"`
// The new chat positions in the chat lists
Positions []*ChatPosition `json:"positions"`
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatDraftMessage) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatDraftMessage
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatDraftMessage) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatDraftMessage) GetType() string {
return TypeUpdateChatDraftMessage
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatDraftMessage) UpdateType() string {
return TypeUpdateChatDraftMessage
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// The message sender that is selected to send messages in a chat has changed
type UpdateChatMessageSender struct {
2021-10-22 16:24:12 +02:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// New value of message_sender_id; may be null if the user can't change message sender
MessageSenderId MessageSender `json:"message_sender_id"`
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatMessageSender) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatMessageSender
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatMessageSender) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatMessageSender) GetType() string {
return TypeUpdateChatMessageSender
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatMessageSender) UpdateType() string {
return TypeUpdateChatMessageSender
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (updateChatMessageSender *UpdateChatMessageSender) UnmarshalJSON(data []byte) error {
var tmp struct {
ChatId int64 `json:"chat_id"`
MessageSenderId json.RawMessage `json:"message_sender_id"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateChatMessageSender.ChatId = tmp.ChatId
fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId)
updateChatMessageSender.MessageSenderId = fieldMessageSenderId
return nil
}
2023-06-04 22:58:07 +02:00
// The message auto-delete or self-destruct timer setting for a chat was changed
type UpdateChatMessageAutoDeleteTime struct {
2021-10-22 16:24:12 +02:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2023-06-04 22:58:07 +02:00
// New value of message_auto_delete_time
MessageAutoDeleteTime int32 `json:"message_auto_delete_time"`
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (entity *UpdateChatMessageAutoDeleteTime) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2023-06-04 22:58:07 +02:00
type stub UpdateChatMessageAutoDeleteTime
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2023-06-04 22:58:07 +02:00
func (*UpdateChatMessageAutoDeleteTime) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassUpdate
}
2023-06-04 22:58:07 +02:00
func (*UpdateChatMessageAutoDeleteTime) GetType() string {
return TypeUpdateChatMessageAutoDeleteTime
2021-10-22 16:24:12 +02:00
}
2023-06-04 22:58:07 +02:00
func (*UpdateChatMessageAutoDeleteTime) UpdateType() string {
return TypeUpdateChatMessageAutoDeleteTime
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// Notification settings for a chat were changed
type UpdateChatNotificationSettings struct {
2021-12-08 10:23:00 +01:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// The new notification settings
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatNotificationSettings) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatNotificationSettings
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatNotificationSettings) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatNotificationSettings) GetType() string {
return TypeUpdateChatNotificationSettings
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatNotificationSettings) UpdateType() string {
return TypeUpdateChatNotificationSettings
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
// The chat pending join requests were changed
type UpdateChatPendingJoinRequests struct {
2021-10-22 16:24:12 +02:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// The new data about pending join requests; may be null
PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"`
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatPendingJoinRequests) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatPendingJoinRequests
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatPendingJoinRequests) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatPendingJoinRequests) GetType() string {
return TypeUpdateChatPendingJoinRequests
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatPendingJoinRequests) UpdateType() string {
return TypeUpdateChatPendingJoinRequests
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// 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
type UpdateChatReplyMarkup struct {
2021-10-22 16:24:12 +02:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// 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"`
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatReplyMarkup) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatReplyMarkup
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatReplyMarkup) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatReplyMarkup) GetType() string {
return TypeUpdateChatReplyMarkup
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatReplyMarkup) UpdateType() string {
return TypeUpdateChatReplyMarkup
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// The chat theme was changed
type UpdateChatTheme struct {
2021-10-22 16:24:12 +02:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// The new name of the chat theme; may be empty if theme was reset to default
ThemeName string `json:"theme_name"`
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatTheme) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatTheme
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatTheme) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatTheme) GetType() string {
return TypeUpdateChatTheme
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatTheme) UpdateType() string {
return TypeUpdateChatTheme
2021-10-22 16:24:12 +02:00
}
// The chat unread_mention_count has changed
type UpdateChatUnreadMentionCount struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The number of unread mention messages left in the chat
UnreadMentionCount int32 `json:"unread_mention_count"`
}
func (entity *UpdateChatUnreadMentionCount) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatUnreadMentionCount
return json.Marshal((*stub)(entity))
}
func (*UpdateChatUnreadMentionCount) GetClass() string {
return ClassUpdate
}
func (*UpdateChatUnreadMentionCount) GetType() string {
return TypeUpdateChatUnreadMentionCount
}
func (*UpdateChatUnreadMentionCount) UpdateType() string {
return TypeUpdateChatUnreadMentionCount
}
2023-06-04 22:58:07 +02:00
// The chat unread_reaction_count has changed
type UpdateChatUnreadReactionCount struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// The number of messages with unread reactions left in the chat
UnreadReactionCount int32 `json:"unread_reaction_count"`
}
func (entity *UpdateChatUnreadReactionCount) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatUnreadReactionCount
return json.Marshal((*stub)(entity))
}
func (*UpdateChatUnreadReactionCount) GetClass() string {
return ClassUpdate
}
func (*UpdateChatUnreadReactionCount) GetType() string {
return TypeUpdateChatUnreadReactionCount
}
func (*UpdateChatUnreadReactionCount) UpdateType() string {
return TypeUpdateChatUnreadReactionCount
}
2022-04-18 22:45:01 +02:00
// A chat video chat state has changed
type UpdateChatVideoChat struct {
2021-12-08 10:23:00 +01:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// New value of video_chat
VideoChat *VideoChat `json:"video_chat"`
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatVideoChat) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatVideoChat
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatVideoChat) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatVideoChat) GetType() string {
return TypeUpdateChatVideoChat
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatVideoChat) UpdateType() string {
return TypeUpdateChatVideoChat
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
// The value of the default disable_notification parameter, used when a message is sent to the chat, was changed
type UpdateChatDefaultDisableNotification struct {
2021-10-22 16:24:12 +02:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// The new default_disable_notification value
DefaultDisableNotification bool `json:"default_disable_notification"`
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatDefaultDisableNotification) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatDefaultDisableNotification
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatDefaultDisableNotification) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatDefaultDisableNotification) GetType() string {
return TypeUpdateChatDefaultDisableNotification
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatDefaultDisableNotification) UpdateType() string {
return TypeUpdateChatDefaultDisableNotification
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// A chat content was allowed or restricted for saving
type UpdateChatHasProtectedContent struct {
2021-12-08 10:23:00 +01:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// New value of has_protected_content
HasProtectedContent bool `json:"has_protected_content"`
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatHasProtectedContent) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatHasProtectedContent
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatHasProtectedContent) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatHasProtectedContent) GetType() string {
return TypeUpdateChatHasProtectedContent
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatHasProtectedContent) UpdateType() string {
return TypeUpdateChatHasProtectedContent
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
// A chat's has_scheduled_messages field has changed
type UpdateChatHasScheduledMessages struct {
2021-12-08 10:23:00 +01:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// New value of has_scheduled_messages
HasScheduledMessages bool `json:"has_scheduled_messages"`
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatHasScheduledMessages) MarshalJSON() ([]byte, error) {
2021-12-08 10:23:00 +01:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatHasScheduledMessages
2021-12-08 10:23:00 +01:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatHasScheduledMessages) GetClass() string {
2021-12-08 10:23:00 +01:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatHasScheduledMessages) GetType() string {
return TypeUpdateChatHasScheduledMessages
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatHasScheduledMessages) UpdateType() string {
return TypeUpdateChatHasScheduledMessages
2021-12-08 10:23:00 +01:00
}
2022-04-18 22:45:01 +02:00
// A chat was blocked or unblocked
type UpdateChatIsBlocked struct {
2021-10-22 16:24:12 +02:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// New value of is_blocked
IsBlocked bool `json:"is_blocked"`
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatIsBlocked) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatIsBlocked
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatIsBlocked) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatIsBlocked) GetType() string {
return TypeUpdateChatIsBlocked
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatIsBlocked) UpdateType() string {
return TypeUpdateChatIsBlocked
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
// A chat was marked as unread or was read
type UpdateChatIsMarkedAsUnread struct {
2021-10-22 16:24:12 +02:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
2022-04-18 22:45:01 +02:00
// New value of is_marked_as_unread
IsMarkedAsUnread bool `json:"is_marked_as_unread"`
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (entity *UpdateChatIsMarkedAsUnread) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2022-04-18 22:45:01 +02:00
type stub UpdateChatIsMarkedAsUnread
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatIsMarkedAsUnread) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassUpdate
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatIsMarkedAsUnread) GetType() string {
return TypeUpdateChatIsMarkedAsUnread
2021-10-22 16:24:12 +02:00
}
2022-04-18 22:45:01 +02:00
func (*UpdateChatIsMarkedAsUnread) UpdateType() string {
return TypeUpdateChatIsMarkedAsUnread
2021-10-22 16:24:12 +02:00
}
// The list of chat filters or a chat filter has changed
type UpdateChatFilters struct {
meta
// The new list of chat filters
ChatFilters []*ChatFilterInfo `json:"chat_filters"`
2023-06-04 22:58:07 +02:00
// Position of the main chat list among chat filters, 0-based
MainChatListPosition int32 `json:"main_chat_list_position"`
2021-10-22 16:24:12 +02:00
}
func (entity *UpdateChatFilters) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatFilters
return json.Marshal((*stub)(entity))
}
func (*UpdateChatFilters) GetClass() string {
return ClassUpdate
}
func (*UpdateChatFilters) GetType() string {
return TypeUpdateChatFilters
}
func (*UpdateChatFilters) UpdateType() string {
return TypeUpdateChatFilters
}
2023-06-04 22:58:07 +02:00
// The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed
2021-10-22 16:24:12 +02:00
type UpdateChatOnlineMemberCount struct {
meta
// Identifier of the chat
ChatId int64 `json:"chat_id"`
// New number of online members in the chat, or 0 if unknown
OnlineMemberCount int32 `json:"online_member_count"`
}
func (entity *UpdateChatOnlineMemberCount) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatOnlineMemberCount
return json.Marshal((*stub)(entity))
}
func (*UpdateChatOnlineMemberCount) GetClass() string {
return ClassUpdate
}
func (*UpdateChatOnlineMemberCount) GetType() string {
return TypeUpdateChatOnlineMemberCount
}
func (*UpdateChatOnlineMemberCount) UpdateType() string {
return TypeUpdateChatOnlineMemberCount
}
2023-06-04 22:58:07 +02:00
// Basic information about a topic in a forum chat was changed
type UpdateForumTopicInfo struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// New information about the topic
Info *ForumTopicInfo `json:"info"`
}
func (entity *UpdateForumTopicInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateForumTopicInfo
return json.Marshal((*stub)(entity))
}
func (*UpdateForumTopicInfo) GetClass() string {
return ClassUpdate
}
func (*UpdateForumTopicInfo) GetType() string {
return TypeUpdateForumTopicInfo
}
func (*UpdateForumTopicInfo) UpdateType() string {
return TypeUpdateForumTopicInfo
}
2022-04-18 22:45:01 +02:00
// Notification settings for some type of chats were updated
type UpdateScopeNotificationSettings struct {
meta
// Types of chats for which notification settings were updated
Scope NotificationSettingsScope `json:"scope"`
// The new notification settings
NotificationSettings *ScopeNotificationSettings `json:"notification_settings"`
}
func (entity *UpdateScopeNotificationSettings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateScopeNotificationSettings
return json.Marshal((*stub)(entity))
}
func (*UpdateScopeNotificationSettings) GetClass() string {
return ClassUpdate
}
func (*UpdateScopeNotificationSettings) GetType() string {
return TypeUpdateScopeNotificationSettings
}
func (*UpdateScopeNotificationSettings) UpdateType() string {
return TypeUpdateScopeNotificationSettings
}
func (updateScopeNotificationSettings *UpdateScopeNotificationSettings) UnmarshalJSON(data []byte) error {
var tmp struct {
Scope json.RawMessage `json:"scope"`
NotificationSettings *ScopeNotificationSettings `json:"notification_settings"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateScopeNotificationSettings.NotificationSettings = tmp.NotificationSettings
fieldScope, _ := UnmarshalNotificationSettingsScope(tmp.Scope)
updateScopeNotificationSettings.Scope = fieldScope
return nil
}
2021-10-22 16:24:12 +02:00
// A notification was changed
type UpdateNotification struct {
meta
// Unique notification group identifier
NotificationGroupId int32 `json:"notification_group_id"`
// Changed notification
Notification *Notification `json:"notification"`
}
func (entity *UpdateNotification) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNotification
return json.Marshal((*stub)(entity))
}
func (*UpdateNotification) GetClass() string {
return ClassUpdate
}
func (*UpdateNotification) GetType() string {
return TypeUpdateNotification
}
func (*UpdateNotification) UpdateType() string {
return TypeUpdateNotification
}
// A list of active notifications in a notification group has changed
type UpdateNotificationGroup struct {
meta
// Unique notification group identifier
NotificationGroupId int32 `json:"notification_group_id"`
// New type of the notification group
Type NotificationGroupType `json:"type"`
// Identifier of a chat to which all notifications in the group belong
ChatId int64 `json:"chat_id"`
// Chat identifier, which notification settings must be applied to the added notifications
NotificationSettingsChatId int64 `json:"notification_settings_chat_id"`
2023-06-04 22:58:07 +02:00
// Identifier of the notification sound to be played; 0 if sound is disabled
NotificationSoundId JsonInt64 `json:"notification_sound_id"`
2021-10-22 16:24:12 +02:00
// Total number of unread notifications in the group, can be bigger than number of active notifications
TotalCount int32 `json:"total_count"`
// List of added group notifications, sorted by notification ID
AddedNotifications []*Notification `json:"added_notifications"`
// Identifiers of removed group notifications, sorted by notification ID
RemovedNotificationIds []int32 `json:"removed_notification_ids"`
}
func (entity *UpdateNotificationGroup) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNotificationGroup
return json.Marshal((*stub)(entity))
}
func (*UpdateNotificationGroup) GetClass() string {
return ClassUpdate
}
func (*UpdateNotificationGroup) GetType() string {
return TypeUpdateNotificationGroup
}
func (*UpdateNotificationGroup) UpdateType() string {
return TypeUpdateNotificationGroup
}
func (updateNotificationGroup *UpdateNotificationGroup) UnmarshalJSON(data []byte) error {
var tmp struct {
NotificationGroupId int32 `json:"notification_group_id"`
Type json.RawMessage `json:"type"`
ChatId int64 `json:"chat_id"`
NotificationSettingsChatId int64 `json:"notification_settings_chat_id"`
2023-06-04 22:58:07 +02:00
NotificationSoundId JsonInt64 `json:"notification_sound_id"`
2021-10-22 16:24:12 +02:00
TotalCount int32 `json:"total_count"`
AddedNotifications []*Notification `json:"added_notifications"`
RemovedNotificationIds []int32 `json:"removed_notification_ids"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateNotificationGroup.NotificationGroupId = tmp.NotificationGroupId
updateNotificationGroup.ChatId = tmp.ChatId
updateNotificationGroup.NotificationSettingsChatId = tmp.NotificationSettingsChatId
2023-06-04 22:58:07 +02:00
updateNotificationGroup.NotificationSoundId = tmp.NotificationSoundId
2021-10-22 16:24:12 +02:00
updateNotificationGroup.TotalCount = tmp.TotalCount
updateNotificationGroup.AddedNotifications = tmp.AddedNotifications
updateNotificationGroup.RemovedNotificationIds = tmp.RemovedNotificationIds
fieldType, _ := UnmarshalNotificationGroupType(tmp.Type)
updateNotificationGroup.Type = fieldType
return nil
}
// Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update
type UpdateActiveNotifications struct {
meta
// Lists of active notification groups
Groups []*NotificationGroup `json:"groups"`
}
func (entity *UpdateActiveNotifications) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateActiveNotifications
return json.Marshal((*stub)(entity))
}
func (*UpdateActiveNotifications) GetClass() string {
return ClassUpdate
}
func (*UpdateActiveNotifications) GetType() string {
return TypeUpdateActiveNotifications
}
func (*UpdateActiveNotifications) UpdateType() string {
return TypeUpdateActiveNotifications
}
// Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications
type UpdateHavePendingNotifications struct {
meta
// True, if there are some delayed notification updates, which will be sent soon
HaveDelayedNotifications bool `json:"have_delayed_notifications"`
// True, if there can be some yet unreceived notifications, which are being fetched from the server
HaveUnreceivedNotifications bool `json:"have_unreceived_notifications"`
}
func (entity *UpdateHavePendingNotifications) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateHavePendingNotifications
return json.Marshal((*stub)(entity))
}
func (*UpdateHavePendingNotifications) GetClass() string {
return ClassUpdate
}
func (*UpdateHavePendingNotifications) GetType() string {
return TypeUpdateHavePendingNotifications
}
func (*UpdateHavePendingNotifications) UpdateType() string {
return TypeUpdateHavePendingNotifications
}
// Some messages were deleted
type UpdateDeleteMessages struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifiers of the deleted messages
MessageIds []int64 `json:"message_ids"`
// True, if the messages are permanently deleted by a user (as opposed to just becoming inaccessible)
IsPermanent bool `json:"is_permanent"`
// True, if the messages are deleted only from the cache and can possibly be retrieved again in the future
FromCache bool `json:"from_cache"`
}
func (entity *UpdateDeleteMessages) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateDeleteMessages
return json.Marshal((*stub)(entity))
}
func (*UpdateDeleteMessages) GetClass() string {
return ClassUpdate
}
func (*UpdateDeleteMessages) GetType() string {
return TypeUpdateDeleteMessages
}
func (*UpdateDeleteMessages) UpdateType() string {
return TypeUpdateDeleteMessages
}
2021-12-08 10:23:00 +01:00
// A message sender activity in the chat has changed
type UpdateChatAction struct {
2021-10-22 16:24:12 +02:00
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// If not 0, a message thread identifier in which the action was performed
MessageThreadId int64 `json:"message_thread_id"`
2021-12-08 10:23:00 +01:00
// Identifier of a message sender performing the action
SenderId MessageSender `json:"sender_id"`
// The action
2021-10-22 16:24:12 +02:00
Action ChatAction `json:"action"`
}
2021-12-08 10:23:00 +01:00
func (entity *UpdateChatAction) MarshalJSON() ([]byte, error) {
2021-10-22 16:24:12 +02:00
entity.meta.Type = entity.GetType()
2021-12-08 10:23:00 +01:00
type stub UpdateChatAction
2021-10-22 16:24:12 +02:00
return json.Marshal((*stub)(entity))
}
2021-12-08 10:23:00 +01:00
func (*UpdateChatAction) GetClass() string {
2021-10-22 16:24:12 +02:00
return ClassUpdate
}
2021-12-08 10:23:00 +01:00
func (*UpdateChatAction) GetType() string {
return TypeUpdateChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (*UpdateChatAction) UpdateType() string {
return TypeUpdateChatAction
2021-10-22 16:24:12 +02:00
}
2021-12-08 10:23:00 +01:00
func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error {
2021-10-22 16:24:12 +02:00
var tmp struct {
ChatId int64 `json:"chat_id"`
MessageThreadId int64 `json:"message_thread_id"`
2021-12-08 10:23:00 +01:00
SenderId json.RawMessage `json:"sender_id"`
2021-10-22 16:24:12 +02:00
Action json.RawMessage `json:"action"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
2021-12-08 10:23:00 +01:00
updateChatAction.ChatId = tmp.ChatId
updateChatAction.MessageThreadId = tmp.MessageThreadId
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
updateChatAction.SenderId = fieldSenderId
2021-10-22 16:24:12 +02:00
fieldAction, _ := UnmarshalChatAction(tmp.Action)
2021-12-08 10:23:00 +01:00
updateChatAction.Action = fieldAction
2021-10-22 16:24:12 +02:00
return nil
}
// The user went online or offline
type UpdateUserStatus struct {
meta
// User identifier
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
// New status of the user
Status UserStatus `json:"status"`
}
func (entity *UpdateUserStatus) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateUserStatus
return json.Marshal((*stub)(entity))
}
func (*UpdateUserStatus) GetClass() string {
return ClassUpdate
}
func (*UpdateUserStatus) GetType() string {
return TypeUpdateUserStatus
}
func (*UpdateUserStatus) UpdateType() string {
return TypeUpdateUserStatus
}
func (updateUserStatus *UpdateUserStatus) UnmarshalJSON(data []byte) error {
var tmp struct {
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
Status json.RawMessage `json:"status"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateUserStatus.UserId = tmp.UserId
fieldStatus, _ := UnmarshalUserStatus(tmp.Status)
updateUserStatus.Status = fieldStatus
return nil
}
// Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application
type UpdateUser struct {
meta
// New data about the user
User *User `json:"user"`
}
func (entity *UpdateUser) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateUser
return json.Marshal((*stub)(entity))
}
func (*UpdateUser) GetClass() string {
return ClassUpdate
}
func (*UpdateUser) GetType() string {
return TypeUpdateUser
}
func (*UpdateUser) UpdateType() string {
return TypeUpdateUser
}
// Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application
type UpdateBasicGroup struct {
meta
// New data about the group
BasicGroup *BasicGroup `json:"basic_group"`
}
func (entity *UpdateBasicGroup) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateBasicGroup
return json.Marshal((*stub)(entity))
}
func (*UpdateBasicGroup) GetClass() string {
return ClassUpdate
}
func (*UpdateBasicGroup) GetType() string {
return TypeUpdateBasicGroup
}
func (*UpdateBasicGroup) UpdateType() string {
return TypeUpdateBasicGroup
}
// Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the application
type UpdateSupergroup struct {
meta
// New data about the supergroup
Supergroup *Supergroup `json:"supergroup"`
}
func (entity *UpdateSupergroup) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateSupergroup
return json.Marshal((*stub)(entity))
}
func (*UpdateSupergroup) GetClass() string {
return ClassUpdate
}
func (*UpdateSupergroup) GetType() string {
return TypeUpdateSupergroup
}
func (*UpdateSupergroup) UpdateType() string {
return TypeUpdateSupergroup
}
// Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application
type UpdateSecretChat struct {
meta
// New data about the secret chat
SecretChat *SecretChat `json:"secret_chat"`
}
func (entity *UpdateSecretChat) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateSecretChat
return json.Marshal((*stub)(entity))
}
func (*UpdateSecretChat) GetClass() string {
return ClassUpdate
}
func (*UpdateSecretChat) GetType() string {
return TypeUpdateSecretChat
}
func (*UpdateSecretChat) UpdateType() string {
return TypeUpdateSecretChat
}
2021-12-08 10:23:00 +01:00
// Some data in userFullInfo has been changed
2021-10-22 16:24:12 +02:00
type UpdateUserFullInfo struct {
meta
// User identifier
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
// New full information about the user
UserFullInfo *UserFullInfo `json:"user_full_info"`
}
func (entity *UpdateUserFullInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateUserFullInfo
return json.Marshal((*stub)(entity))
}
func (*UpdateUserFullInfo) GetClass() string {
return ClassUpdate
}
func (*UpdateUserFullInfo) GetType() string {
return TypeUpdateUserFullInfo
}
func (*UpdateUserFullInfo) UpdateType() string {
return TypeUpdateUserFullInfo
}
2021-12-08 10:23:00 +01:00
// Some data in basicGroupFullInfo has been changed
2021-10-22 16:24:12 +02:00
type UpdateBasicGroupFullInfo struct {
meta
// Identifier of a basic group
2021-12-08 10:23:00 +01:00
BasicGroupId int64 `json:"basic_group_id"`
2021-10-22 16:24:12 +02:00
// New full information about the group
BasicGroupFullInfo *BasicGroupFullInfo `json:"basic_group_full_info"`
}
func (entity *UpdateBasicGroupFullInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateBasicGroupFullInfo
return json.Marshal((*stub)(entity))
}
func (*UpdateBasicGroupFullInfo) GetClass() string {
return ClassUpdate
}
func (*UpdateBasicGroupFullInfo) GetType() string {
return TypeUpdateBasicGroupFullInfo
}
func (*UpdateBasicGroupFullInfo) UpdateType() string {
return TypeUpdateBasicGroupFullInfo
}
2021-12-08 10:23:00 +01:00
// Some data in supergroupFullInfo has been changed
2021-10-22 16:24:12 +02:00
type UpdateSupergroupFullInfo struct {
meta
// Identifier of the supergroup or channel
2021-12-08 10:23:00 +01:00
SupergroupId int64 `json:"supergroup_id"`
2021-10-22 16:24:12 +02:00
// New full information about the supergroup
SupergroupFullInfo *SupergroupFullInfo `json:"supergroup_full_info"`
}
func (entity *UpdateSupergroupFullInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateSupergroupFullInfo
return json.Marshal((*stub)(entity))
}
func (*UpdateSupergroupFullInfo) GetClass() string {
return ClassUpdate
}
func (*UpdateSupergroupFullInfo) GetType() string {
return TypeUpdateSupergroupFullInfo
}
func (*UpdateSupergroupFullInfo) UpdateType() string {
return TypeUpdateSupergroupFullInfo
}
2021-12-08 10:23:00 +01:00
// A service notification from the server was received. Upon receiving this the application must show a popup with the content of the notification
2021-10-22 16:24:12 +02:00
type UpdateServiceNotification struct {
meta
2021-12-08 10:23:00 +01:00
// Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" must be shown under notification; if user presses the second, all local data must be destroyed using Destroy method
2021-10-22 16:24:12 +02:00
Type string `json:"type"`
// Notification content
Content MessageContent `json:"content"`
}
func (entity *UpdateServiceNotification) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateServiceNotification
return json.Marshal((*stub)(entity))
}
func (*UpdateServiceNotification) GetClass() string {
return ClassUpdate
}
func (*UpdateServiceNotification) GetType() string {
return TypeUpdateServiceNotification
}
func (*UpdateServiceNotification) UpdateType() string {
return TypeUpdateServiceNotification
}
func (updateServiceNotification *UpdateServiceNotification) UnmarshalJSON(data []byte) error {
var tmp struct {
Type string `json:"type"`
Content json.RawMessage `json:"content"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateServiceNotification.Type = tmp.Type
fieldContent, _ := UnmarshalMessageContent(tmp.Content)
updateServiceNotification.Content = fieldContent
return nil
}
// Information about a file was updated
type UpdateFile struct {
meta
// New data about the file
File *File `json:"file"`
}
func (entity *UpdateFile) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFile
return json.Marshal((*stub)(entity))
}
func (*UpdateFile) GetClass() string {
return ClassUpdate
}
func (*UpdateFile) GetType() string {
return TypeUpdateFile
}
func (*UpdateFile) UpdateType() string {
return TypeUpdateFile
}
// The file generation process needs to be started by the application
type UpdateFileGenerationStart struct {
meta
// Unique identifier for the generation process
GenerationId JsonInt64 `json:"generation_id"`
// The path to a file from which a new file is generated; may be empty
OriginalPath string `json:"original_path"`
2021-12-08 10:23:00 +01:00
// The path to a file that must be created and where the new file is generated
2021-10-22 16:24:12 +02:00
DestinationPath string `json:"destination_path"`
2021-12-08 10:23:00 +01:00
// String specifying the conversion applied to the original file. If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which must be downloaded by the application
2021-10-22 16:24:12 +02:00
Conversion string `json:"conversion"`
}
func (entity *UpdateFileGenerationStart) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFileGenerationStart
return json.Marshal((*stub)(entity))
}
func (*UpdateFileGenerationStart) GetClass() string {
return ClassUpdate
}
func (*UpdateFileGenerationStart) GetType() string {
return TypeUpdateFileGenerationStart
}
func (*UpdateFileGenerationStart) UpdateType() string {
return TypeUpdateFileGenerationStart
}
// File generation is no longer needed
type UpdateFileGenerationStop struct {
meta
// Unique identifier for the generation process
GenerationId JsonInt64 `json:"generation_id"`
}
func (entity *UpdateFileGenerationStop) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFileGenerationStop
return json.Marshal((*stub)(entity))
}
func (*UpdateFileGenerationStop) GetClass() string {
return ClassUpdate
}
func (*UpdateFileGenerationStop) GetType() string {
return TypeUpdateFileGenerationStop
}
func (*UpdateFileGenerationStop) UpdateType() string {
return TypeUpdateFileGenerationStop
}
2023-06-04 22:58:07 +02:00
// The state of the file download list has changed
type UpdateFileDownloads struct {
meta
// Total size of files in the file download list, in bytes
TotalSize int64 `json:"total_size"`
// Total number of files in the file download list
TotalCount int32 `json:"total_count"`
// Total downloaded size of files in the file download list, in bytes
DownloadedSize int64 `json:"downloaded_size"`
}
func (entity *UpdateFileDownloads) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFileDownloads
return json.Marshal((*stub)(entity))
}
func (*UpdateFileDownloads) GetClass() string {
return ClassUpdate
}
func (*UpdateFileDownloads) GetType() string {
return TypeUpdateFileDownloads
}
func (*UpdateFileDownloads) UpdateType() string {
return TypeUpdateFileDownloads
}
// A file was added to the file download list. This update is sent only after file download list is loaded for the first time
type UpdateFileAddedToDownloads struct {
meta
// The added file download
FileDownload *FileDownload `json:"file_download"`
// New number of being downloaded and recently downloaded files found
Counts *DownloadedFileCounts `json:"counts"`
}
func (entity *UpdateFileAddedToDownloads) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFileAddedToDownloads
return json.Marshal((*stub)(entity))
}
func (*UpdateFileAddedToDownloads) GetClass() string {
return ClassUpdate
}
func (*UpdateFileAddedToDownloads) GetType() string {
return TypeUpdateFileAddedToDownloads
}
func (*UpdateFileAddedToDownloads) UpdateType() string {
return TypeUpdateFileAddedToDownloads
}
// A file download was changed. This update is sent only after file download list is loaded for the first time
type UpdateFileDownload struct {
meta
// File identifier
FileId int32 `json:"file_id"`
// Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed
CompleteDate int32 `json:"complete_date"`
// True, if downloading of the file is paused
IsPaused bool `json:"is_paused"`
// New number of being downloaded and recently downloaded files found
Counts *DownloadedFileCounts `json:"counts"`
}
func (entity *UpdateFileDownload) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFileDownload
return json.Marshal((*stub)(entity))
}
func (*UpdateFileDownload) GetClass() string {
return ClassUpdate
}
func (*UpdateFileDownload) GetType() string {
return TypeUpdateFileDownload
}
func (*UpdateFileDownload) UpdateType() string {
return TypeUpdateFileDownload
}
// A file was removed from the file download list. This update is sent only after file download list is loaded for the first time
type UpdateFileRemovedFromDownloads struct {
meta
// File identifier
FileId int32 `json:"file_id"`
// New number of being downloaded and recently downloaded files found
Counts *DownloadedFileCounts `json:"counts"`
}
func (entity *UpdateFileRemovedFromDownloads) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFileRemovedFromDownloads
return json.Marshal((*stub)(entity))
}
func (*UpdateFileRemovedFromDownloads) GetClass() string {
return ClassUpdate
}
func (*UpdateFileRemovedFromDownloads) GetType() string {
return TypeUpdateFileRemovedFromDownloads
}
func (*UpdateFileRemovedFromDownloads) UpdateType() string {
return TypeUpdateFileRemovedFromDownloads
}
2021-10-22 16:24:12 +02:00
// New call was created or information about a call was updated
type UpdateCall struct {
meta
// New data about a call
Call *Call `json:"call"`
}
func (entity *UpdateCall) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateCall
return json.Marshal((*stub)(entity))
}
func (*UpdateCall) GetClass() string {
return ClassUpdate
}
func (*UpdateCall) GetType() string {
return TypeUpdateCall
}
func (*UpdateCall) UpdateType() string {
return TypeUpdateCall
}
2021-12-08 10:23:00 +01:00
// Information about a group call was updated
type UpdateGroupCall struct {
meta
// New data about a group call
GroupCall *GroupCall `json:"group_call"`
}
func (entity *UpdateGroupCall) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateGroupCall
return json.Marshal((*stub)(entity))
}
func (*UpdateGroupCall) GetClass() string {
return ClassUpdate
}
func (*UpdateGroupCall) GetType() string {
return TypeUpdateGroupCall
}
func (*UpdateGroupCall) UpdateType() string {
return TypeUpdateGroupCall
}
// Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined
type UpdateGroupCallParticipant struct {
meta
// Identifier of group call
GroupCallId int32 `json:"group_call_id"`
// New data about a participant
Participant *GroupCallParticipant `json:"participant"`
}
func (entity *UpdateGroupCallParticipant) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateGroupCallParticipant
return json.Marshal((*stub)(entity))
}
func (*UpdateGroupCallParticipant) GetClass() string {
return ClassUpdate
}
func (*UpdateGroupCallParticipant) GetType() string {
return TypeUpdateGroupCallParticipant
}
func (*UpdateGroupCallParticipant) UpdateType() string {
return TypeUpdateGroupCallParticipant
}
2021-10-22 16:24:12 +02:00
// New call signaling data arrived
type UpdateNewCallSignalingData struct {
meta
// The call identifier
CallId int32 `json:"call_id"`
// The data
Data []byte `json:"data"`
}
func (entity *UpdateNewCallSignalingData) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewCallSignalingData
return json.Marshal((*stub)(entity))
}
func (*UpdateNewCallSignalingData) GetClass() string {
return ClassUpdate
}
func (*UpdateNewCallSignalingData) GetType() string {
return TypeUpdateNewCallSignalingData
}
func (*UpdateNewCallSignalingData) UpdateType() string {
return TypeUpdateNewCallSignalingData
}
// Some privacy setting rules have been changed
type UpdateUserPrivacySettingRules struct {
meta
// The privacy setting
Setting UserPrivacySetting `json:"setting"`
// New privacy rules
Rules *UserPrivacySettingRules `json:"rules"`
}
func (entity *UpdateUserPrivacySettingRules) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateUserPrivacySettingRules
return json.Marshal((*stub)(entity))
}
func (*UpdateUserPrivacySettingRules) GetClass() string {
return ClassUpdate
}
func (*UpdateUserPrivacySettingRules) GetType() string {
return TypeUpdateUserPrivacySettingRules
}
func (*UpdateUserPrivacySettingRules) UpdateType() string {
return TypeUpdateUserPrivacySettingRules
}
func (updateUserPrivacySettingRules *UpdateUserPrivacySettingRules) UnmarshalJSON(data []byte) error {
var tmp struct {
Setting json.RawMessage `json:"setting"`
Rules *UserPrivacySettingRules `json:"rules"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateUserPrivacySettingRules.Rules = tmp.Rules
fieldSetting, _ := UnmarshalUserPrivacySetting(tmp.Setting)
updateUserPrivacySettingRules.Setting = fieldSetting
return nil
}
// Number of unread messages in a chat list has changed. This update is sent only if the message database is used
type UpdateUnreadMessageCount struct {
meta
// The chat list with changed number of unread messages
ChatList ChatList `json:"chat_list"`
// Total number of unread messages
UnreadCount int32 `json:"unread_count"`
// Total number of unread messages in unmuted chats
UnreadUnmutedCount int32 `json:"unread_unmuted_count"`
}
func (entity *UpdateUnreadMessageCount) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateUnreadMessageCount
return json.Marshal((*stub)(entity))
}
func (*UpdateUnreadMessageCount) GetClass() string {
return ClassUpdate
}
func (*UpdateUnreadMessageCount) GetType() string {
return TypeUpdateUnreadMessageCount
}
func (*UpdateUnreadMessageCount) UpdateType() string {
return TypeUpdateUnreadMessageCount
}
func (updateUnreadMessageCount *UpdateUnreadMessageCount) UnmarshalJSON(data []byte) error {
var tmp struct {
ChatList json.RawMessage `json:"chat_list"`
UnreadCount int32 `json:"unread_count"`
UnreadUnmutedCount int32 `json:"unread_unmuted_count"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateUnreadMessageCount.UnreadCount = tmp.UnreadCount
updateUnreadMessageCount.UnreadUnmutedCount = tmp.UnreadUnmutedCount
fieldChatList, _ := UnmarshalChatList(tmp.ChatList)
updateUnreadMessageCount.ChatList = fieldChatList
return nil
}
// Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used
type UpdateUnreadChatCount struct {
meta
// The chat list with changed number of unread messages
ChatList ChatList `json:"chat_list"`
// Approximate total number of chats in the chat list
TotalCount int32 `json:"total_count"`
// Total number of unread chats
UnreadCount int32 `json:"unread_count"`
// Total number of unread unmuted chats
UnreadUnmutedCount int32 `json:"unread_unmuted_count"`
// Total number of chats marked as unread
MarkedAsUnreadCount int32 `json:"marked_as_unread_count"`
// Total number of unmuted chats marked as unread
MarkedAsUnreadUnmutedCount int32 `json:"marked_as_unread_unmuted_count"`
}
func (entity *UpdateUnreadChatCount) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateUnreadChatCount
return json.Marshal((*stub)(entity))
}
func (*UpdateUnreadChatCount) GetClass() string {
return ClassUpdate
}
func (*UpdateUnreadChatCount) GetType() string {
return TypeUpdateUnreadChatCount
}
func (*UpdateUnreadChatCount) UpdateType() string {
return TypeUpdateUnreadChatCount
}
func (updateUnreadChatCount *UpdateUnreadChatCount) UnmarshalJSON(data []byte) error {
var tmp struct {
ChatList json.RawMessage `json:"chat_list"`
TotalCount int32 `json:"total_count"`
UnreadCount int32 `json:"unread_count"`
UnreadUnmutedCount int32 `json:"unread_unmuted_count"`
MarkedAsUnreadCount int32 `json:"marked_as_unread_count"`
MarkedAsUnreadUnmutedCount int32 `json:"marked_as_unread_unmuted_count"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateUnreadChatCount.TotalCount = tmp.TotalCount
updateUnreadChatCount.UnreadCount = tmp.UnreadCount
updateUnreadChatCount.UnreadUnmutedCount = tmp.UnreadUnmutedCount
updateUnreadChatCount.MarkedAsUnreadCount = tmp.MarkedAsUnreadCount
updateUnreadChatCount.MarkedAsUnreadUnmutedCount = tmp.MarkedAsUnreadUnmutedCount
fieldChatList, _ := UnmarshalChatList(tmp.ChatList)
updateUnreadChatCount.ChatList = fieldChatList
return nil
}
// An option changed its value
type UpdateOption struct {
meta
// The option name
Name string `json:"name"`
// The new option value
Value OptionValue `json:"value"`
}
func (entity *UpdateOption) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateOption
return json.Marshal((*stub)(entity))
}
func (*UpdateOption) GetClass() string {
return ClassUpdate
}
func (*UpdateOption) GetType() string {
return TypeUpdateOption
}
func (*UpdateOption) UpdateType() string {
return TypeUpdateOption
}
func (updateOption *UpdateOption) UnmarshalJSON(data []byte) error {
var tmp struct {
Name string `json:"name"`
Value json.RawMessage `json:"value"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateOption.Name = tmp.Name
fieldValue, _ := UnmarshalOptionValue(tmp.Value)
updateOption.Value = fieldValue
return nil
}
// A sticker set has changed
type UpdateStickerSet struct {
meta
// The sticker set
StickerSet *StickerSet `json:"sticker_set"`
}
func (entity *UpdateStickerSet) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateStickerSet
return json.Marshal((*stub)(entity))
}
func (*UpdateStickerSet) GetClass() string {
return ClassUpdate
}
func (*UpdateStickerSet) GetType() string {
return TypeUpdateStickerSet
}
func (*UpdateStickerSet) UpdateType() string {
return TypeUpdateStickerSet
}
// The list of installed sticker sets was updated
type UpdateInstalledStickerSets struct {
meta
2023-06-04 22:58:07 +02:00
// Type of the affected stickers
StickerType StickerType `json:"sticker_type"`
2021-10-22 16:24:12 +02:00
// The new list of installed ordinary sticker sets
StickerSetIds []JsonInt64 `json:"sticker_set_ids"`
}
func (entity *UpdateInstalledStickerSets) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateInstalledStickerSets
return json.Marshal((*stub)(entity))
}
func (*UpdateInstalledStickerSets) GetClass() string {
return ClassUpdate
}
func (*UpdateInstalledStickerSets) GetType() string {
return TypeUpdateInstalledStickerSets
}
func (*UpdateInstalledStickerSets) UpdateType() string {
return TypeUpdateInstalledStickerSets
}
2023-06-04 22:58:07 +02:00
func (updateInstalledStickerSets *UpdateInstalledStickerSets) UnmarshalJSON(data []byte) error {
var tmp struct {
StickerType json.RawMessage `json:"sticker_type"`
StickerSetIds []JsonInt64 `json:"sticker_set_ids"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateInstalledStickerSets.StickerSetIds = tmp.StickerSetIds
fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType)
updateInstalledStickerSets.StickerType = fieldStickerType
return nil
}
2021-10-22 16:24:12 +02:00
// The list of trending sticker sets was updated or some of them were viewed
type UpdateTrendingStickerSets struct {
meta
2023-06-04 22:58:07 +02:00
// Type of the affected stickers
StickerType StickerType `json:"sticker_type"`
2021-10-22 16:24:12 +02:00
// The prefix of the list of trending sticker sets with the newest trending sticker sets
2023-06-04 22:58:07 +02:00
StickerSets *TrendingStickerSets `json:"sticker_sets"`
2021-10-22 16:24:12 +02:00
}
func (entity *UpdateTrendingStickerSets) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateTrendingStickerSets
return json.Marshal((*stub)(entity))
}
func (*UpdateTrendingStickerSets) GetClass() string {
return ClassUpdate
}
func (*UpdateTrendingStickerSets) GetType() string {
return TypeUpdateTrendingStickerSets
}
func (*UpdateTrendingStickerSets) UpdateType() string {
return TypeUpdateTrendingStickerSets
}
2023-06-04 22:58:07 +02:00
func (updateTrendingStickerSets *UpdateTrendingStickerSets) UnmarshalJSON(data []byte) error {
var tmp struct {
StickerType json.RawMessage `json:"sticker_type"`
StickerSets *TrendingStickerSets `json:"sticker_sets"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateTrendingStickerSets.StickerSets = tmp.StickerSets
fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType)
updateTrendingStickerSets.StickerType = fieldStickerType
return nil
}
2021-10-22 16:24:12 +02:00
// The list of recently used stickers was updated
type UpdateRecentStickers struct {
meta
// True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated
IsAttached bool `json:"is_attached"`
// The new list of file identifiers of recently used stickers
StickerIds []int32 `json:"sticker_ids"`
}
func (entity *UpdateRecentStickers) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateRecentStickers
return json.Marshal((*stub)(entity))
}
func (*UpdateRecentStickers) GetClass() string {
return ClassUpdate
}
func (*UpdateRecentStickers) GetType() string {
return TypeUpdateRecentStickers
}
func (*UpdateRecentStickers) UpdateType() string {
return TypeUpdateRecentStickers
}
// The list of favorite stickers was updated
type UpdateFavoriteStickers struct {
meta
// The new list of file identifiers of favorite stickers
StickerIds []int32 `json:"sticker_ids"`
}
func (entity *UpdateFavoriteStickers) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateFavoriteStickers
return json.Marshal((*stub)(entity))
}
func (*UpdateFavoriteStickers) GetClass() string {
return ClassUpdate
}
func (*UpdateFavoriteStickers) GetType() string {
return TypeUpdateFavoriteStickers
}
func (*UpdateFavoriteStickers) UpdateType() string {
return TypeUpdateFavoriteStickers
}
// The list of saved animations was updated
type UpdateSavedAnimations struct {
meta
// The new list of file identifiers of saved animations
AnimationIds []int32 `json:"animation_ids"`
}
func (entity *UpdateSavedAnimations) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateSavedAnimations
return json.Marshal((*stub)(entity))
}
func (*UpdateSavedAnimations) GetClass() string {
return ClassUpdate
}
func (*UpdateSavedAnimations) GetType() string {
return TypeUpdateSavedAnimations
}
func (*UpdateSavedAnimations) UpdateType() string {
return TypeUpdateSavedAnimations
}
2023-06-04 22:58:07 +02:00
// The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time
type UpdateSavedNotificationSounds struct {
meta
// The new list of identifiers of saved notification sounds
NotificationSoundIds []JsonInt64 `json:"notification_sound_ids"`
}
func (entity *UpdateSavedNotificationSounds) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateSavedNotificationSounds
return json.Marshal((*stub)(entity))
}
func (*UpdateSavedNotificationSounds) GetClass() string {
return ClassUpdate
}
func (*UpdateSavedNotificationSounds) GetType() string {
return TypeUpdateSavedNotificationSounds
}
func (*UpdateSavedNotificationSounds) UpdateType() string {
return TypeUpdateSavedNotificationSounds
}
2021-10-22 16:24:12 +02:00
// The selected background has changed
type UpdateSelectedBackground struct {
meta
// True, if background for dark theme has changed
ForDarkTheme bool `json:"for_dark_theme"`
// The new selected background; may be null
Background *Background `json:"background"`
}
func (entity *UpdateSelectedBackground) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateSelectedBackground
return json.Marshal((*stub)(entity))
}
func (*UpdateSelectedBackground) GetClass() string {
return ClassUpdate
}
func (*UpdateSelectedBackground) GetType() string {
return TypeUpdateSelectedBackground
}
func (*UpdateSelectedBackground) UpdateType() string {
return TypeUpdateSelectedBackground
}
2021-12-08 10:23:00 +01:00
// The list of available chat themes has changed
type UpdateChatThemes struct {
meta
// The new list of chat themes
ChatThemes []*ChatTheme `json:"chat_themes"`
}
func (entity *UpdateChatThemes) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatThemes
return json.Marshal((*stub)(entity))
}
func (*UpdateChatThemes) GetClass() string {
return ClassUpdate
}
func (*UpdateChatThemes) GetType() string {
return TypeUpdateChatThemes
}
func (*UpdateChatThemes) UpdateType() string {
return TypeUpdateChatThemes
}
2021-10-22 16:24:12 +02:00
// Some language pack strings have been updated
type UpdateLanguagePackStrings struct {
meta
// Localization target to which the language pack belongs
LocalizationTarget string `json:"localization_target"`
// Identifier of the updated language pack
LanguagePackId string `json:"language_pack_id"`
// List of changed language pack strings
Strings []*LanguagePackString `json:"strings"`
}
func (entity *UpdateLanguagePackStrings) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateLanguagePackStrings
return json.Marshal((*stub)(entity))
}
func (*UpdateLanguagePackStrings) GetClass() string {
return ClassUpdate
}
func (*UpdateLanguagePackStrings) GetType() string {
return TypeUpdateLanguagePackStrings
}
func (*UpdateLanguagePackStrings) UpdateType() string {
return TypeUpdateLanguagePackStrings
}
// The connection state has changed. This update must be used only to show a human-readable description of the connection state
type UpdateConnectionState struct {
meta
// The new connection state
State ConnectionState `json:"state"`
}
func (entity *UpdateConnectionState) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateConnectionState
return json.Marshal((*stub)(entity))
}
func (*UpdateConnectionState) GetClass() string {
return ClassUpdate
}
func (*UpdateConnectionState) GetType() string {
return TypeUpdateConnectionState
}
func (*UpdateConnectionState) UpdateType() string {
return TypeUpdateConnectionState
}
func (updateConnectionState *UpdateConnectionState) UnmarshalJSON(data []byte) error {
var tmp struct {
State json.RawMessage `json:"state"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldState, _ := UnmarshalConnectionState(tmp.State)
updateConnectionState.State = fieldState
return nil
}
2021-12-08 10:23:00 +01:00
// New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update"
2021-10-22 16:24:12 +02:00
type UpdateTermsOfService struct {
meta
// Identifier of the terms of service
TermsOfServiceId string `json:"terms_of_service_id"`
// The new terms of service
TermsOfService *TermsOfService `json:"terms_of_service"`
}
func (entity *UpdateTermsOfService) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateTermsOfService
return json.Marshal((*stub)(entity))
}
func (*UpdateTermsOfService) GetClass() string {
return ClassUpdate
}
func (*UpdateTermsOfService) GetType() string {
return TypeUpdateTermsOfService
}
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
}
2023-06-04 22:58:07 +02:00
// The list of bots added to attachment menu has changed
type UpdateAttachmentMenuBots struct {
meta
// The new list of bots added to attachment menu. The bots must not be shown on scheduled messages screen
Bots []*AttachmentMenuBot `json:"bots"`
}
func (entity *UpdateAttachmentMenuBots) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateAttachmentMenuBots
return json.Marshal((*stub)(entity))
}
func (*UpdateAttachmentMenuBots) GetClass() string {
return ClassUpdate
}
func (*UpdateAttachmentMenuBots) GetType() string {
return TypeUpdateAttachmentMenuBots
}
func (*UpdateAttachmentMenuBots) UpdateType() string {
return TypeUpdateAttachmentMenuBots
}
// A message was sent by an opened Web App, so the Web App needs to be closed
type UpdateWebAppMessageSent struct {
meta
// Identifier of Web App launch
WebAppLaunchId JsonInt64 `json:"web_app_launch_id"`
}
func (entity *UpdateWebAppMessageSent) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateWebAppMessageSent
return json.Marshal((*stub)(entity))
}
func (*UpdateWebAppMessageSent) GetClass() string {
return ClassUpdate
}
func (*UpdateWebAppMessageSent) GetType() string {
return TypeUpdateWebAppMessageSent
}
func (*UpdateWebAppMessageSent) UpdateType() string {
return TypeUpdateWebAppMessageSent
}
// The list of active emoji reactions has changed
type UpdateActiveEmojiReactions struct {
meta
// The new list of active emoji reactions
Emojis []string `json:"emojis"`
}
func (entity *UpdateActiveEmojiReactions) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateActiveEmojiReactions
return json.Marshal((*stub)(entity))
}
func (*UpdateActiveEmojiReactions) GetClass() string {
return ClassUpdate
}
func (*UpdateActiveEmojiReactions) GetType() string {
return TypeUpdateActiveEmojiReactions
}
func (*UpdateActiveEmojiReactions) UpdateType() string {
return TypeUpdateActiveEmojiReactions
}
// The type of default reaction has changed
type UpdateDefaultReactionType struct {
meta
// The new type of the default reaction
ReactionType ReactionType `json:"reaction_type"`
}
func (entity *UpdateDefaultReactionType) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateDefaultReactionType
return json.Marshal((*stub)(entity))
}
func (*UpdateDefaultReactionType) GetClass() string {
return ClassUpdate
}
func (*UpdateDefaultReactionType) GetType() string {
return TypeUpdateDefaultReactionType
}
func (*UpdateDefaultReactionType) UpdateType() string {
return TypeUpdateDefaultReactionType
}
func (updateDefaultReactionType *UpdateDefaultReactionType) UnmarshalJSON(data []byte) error {
var tmp struct {
ReactionType json.RawMessage `json:"reaction_type"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldReactionType, _ := UnmarshalReactionType(tmp.ReactionType)
updateDefaultReactionType.ReactionType = fieldReactionType
return nil
}
2021-10-22 16:24:12 +02:00
// The list of supported dice emojis has changed
type UpdateDiceEmojis struct {
meta
// The new list of supported dice emojis
Emojis []string `json:"emojis"`
}
func (entity *UpdateDiceEmojis) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateDiceEmojis
return json.Marshal((*stub)(entity))
}
func (*UpdateDiceEmojis) GetClass() string {
return ClassUpdate
}
func (*UpdateDiceEmojis) GetType() string {
return TypeUpdateDiceEmojis
}
func (*UpdateDiceEmojis) UpdateType() string {
return TypeUpdateDiceEmojis
}
2021-12-08 10:23:00 +01:00
// Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played
type UpdateAnimatedEmojiMessageClicked struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
// The animated sticker to be played
Sticker *Sticker `json:"sticker"`
}
func (entity *UpdateAnimatedEmojiMessageClicked) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateAnimatedEmojiMessageClicked
return json.Marshal((*stub)(entity))
}
func (*UpdateAnimatedEmojiMessageClicked) GetClass() string {
return ClassUpdate
}
func (*UpdateAnimatedEmojiMessageClicked) GetType() string {
return TypeUpdateAnimatedEmojiMessageClicked
}
func (*UpdateAnimatedEmojiMessageClicked) UpdateType() string {
return TypeUpdateAnimatedEmojiMessageClicked
}
2023-06-04 22:58:07 +02:00
// The parameters of animation search through getOption("animation_search_bot_username") bot has changed
2021-10-22 16:24:12 +02:00
type UpdateAnimationSearchParameters struct {
meta
// Name of the animation search provider
Provider string `json:"provider"`
// The new list of emojis suggested for searching
Emojis []string `json:"emojis"`
}
func (entity *UpdateAnimationSearchParameters) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateAnimationSearchParameters
return json.Marshal((*stub)(entity))
}
func (*UpdateAnimationSearchParameters) GetClass() string {
return ClassUpdate
}
func (*UpdateAnimationSearchParameters) GetType() string {
return TypeUpdateAnimationSearchParameters
}
func (*UpdateAnimationSearchParameters) UpdateType() string {
return TypeUpdateAnimationSearchParameters
}
// The list of suggested to the user actions has changed
type UpdateSuggestedActions struct {
meta
// Added suggested actions
AddedActions []SuggestedAction `json:"added_actions"`
// Removed suggested actions
RemovedActions []SuggestedAction `json:"removed_actions"`
}
func (entity *UpdateSuggestedActions) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateSuggestedActions
return json.Marshal((*stub)(entity))
}
func (*UpdateSuggestedActions) GetClass() string {
return ClassUpdate
}
func (*UpdateSuggestedActions) GetType() string {
return TypeUpdateSuggestedActions
}
func (*UpdateSuggestedActions) UpdateType() string {
return TypeUpdateSuggestedActions
}
func (updateSuggestedActions *UpdateSuggestedActions) UnmarshalJSON(data []byte) error {
var tmp struct {
AddedActions []json.RawMessage `json:"added_actions"`
RemovedActions []json.RawMessage `json:"removed_actions"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldAddedActions, _ := UnmarshalListOfSuggestedAction(tmp.AddedActions)
updateSuggestedActions.AddedActions = fieldAddedActions
fieldRemovedActions, _ := UnmarshalListOfSuggestedAction(tmp.RemovedActions)
updateSuggestedActions.RemovedActions = fieldRemovedActions
return nil
}
// A new incoming inline query; for bots only
type UpdateNewInlineQuery struct {
meta
// Unique query identifier
Id JsonInt64 `json:"id"`
// Identifier of the user who sent the query
2021-12-08 10:23:00 +01:00
SenderUserId int64 `json:"sender_user_id"`
2021-10-22 16:24:12 +02:00
// User location; may be null
UserLocation *Location `json:"user_location"`
2023-06-04 22:58:07 +02:00
// The type of the chat from which the query originated; may be null if unknown
2021-12-08 10:23:00 +01:00
ChatType ChatType `json:"chat_type"`
2021-10-22 16:24:12 +02:00
// Text of the query
Query string `json:"query"`
// Offset of the first entry to return
Offset string `json:"offset"`
}
func (entity *UpdateNewInlineQuery) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewInlineQuery
return json.Marshal((*stub)(entity))
}
func (*UpdateNewInlineQuery) GetClass() string {
return ClassUpdate
}
func (*UpdateNewInlineQuery) GetType() string {
return TypeUpdateNewInlineQuery
}
func (*UpdateNewInlineQuery) UpdateType() string {
return TypeUpdateNewInlineQuery
}
2021-12-08 10:23:00 +01:00
func (updateNewInlineQuery *UpdateNewInlineQuery) UnmarshalJSON(data []byte) error {
var tmp struct {
Id JsonInt64 `json:"id"`
SenderUserId int64 `json:"sender_user_id"`
UserLocation *Location `json:"user_location"`
ChatType json.RawMessage `json:"chat_type"`
Query string `json:"query"`
Offset string `json:"offset"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateNewInlineQuery.Id = tmp.Id
updateNewInlineQuery.SenderUserId = tmp.SenderUserId
updateNewInlineQuery.UserLocation = tmp.UserLocation
updateNewInlineQuery.Query = tmp.Query
updateNewInlineQuery.Offset = tmp.Offset
fieldChatType, _ := UnmarshalChatType(tmp.ChatType)
updateNewInlineQuery.ChatType = fieldChatType
return nil
}
2021-10-22 16:24:12 +02:00
// The user has chosen a result of an inline query; for bots only
type UpdateNewChosenInlineResult struct {
meta
// Identifier of the user who sent the query
2021-12-08 10:23:00 +01:00
SenderUserId int64 `json:"sender_user_id"`
2021-10-22 16:24:12 +02:00
// User location; may be null
UserLocation *Location `json:"user_location"`
// Text of the query
Query string `json:"query"`
// Identifier of the chosen result
ResultId string `json:"result_id"`
// Identifier of the sent inline message, if known
InlineMessageId string `json:"inline_message_id"`
}
func (entity *UpdateNewChosenInlineResult) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewChosenInlineResult
return json.Marshal((*stub)(entity))
}
func (*UpdateNewChosenInlineResult) GetClass() string {
return ClassUpdate
}
func (*UpdateNewChosenInlineResult) GetType() string {
return TypeUpdateNewChosenInlineResult
}
func (*UpdateNewChosenInlineResult) UpdateType() string {
return TypeUpdateNewChosenInlineResult
}
// A new incoming callback query; for bots only
type UpdateNewCallbackQuery struct {
meta
// Unique query identifier
Id JsonInt64 `json:"id"`
// Identifier of the user who sent the query
2021-12-08 10:23:00 +01:00
SenderUserId int64 `json:"sender_user_id"`
2021-10-22 16:24:12 +02:00
// Identifier of the chat where the query was sent
ChatId int64 `json:"chat_id"`
2023-06-04 22:58:07 +02:00
// Identifier of the message from which the query originated
2021-10-22 16:24:12 +02:00
MessageId int64 `json:"message_id"`
// Identifier that uniquely corresponds to the chat to which the message was sent
ChatInstance JsonInt64 `json:"chat_instance"`
// Query payload
Payload CallbackQueryPayload `json:"payload"`
}
func (entity *UpdateNewCallbackQuery) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewCallbackQuery
return json.Marshal((*stub)(entity))
}
func (*UpdateNewCallbackQuery) GetClass() string {
return ClassUpdate
}
func (*UpdateNewCallbackQuery) GetType() string {
return TypeUpdateNewCallbackQuery
}
func (*UpdateNewCallbackQuery) UpdateType() string {
return TypeUpdateNewCallbackQuery
}
func (updateNewCallbackQuery *UpdateNewCallbackQuery) UnmarshalJSON(data []byte) error {
var tmp struct {
Id JsonInt64 `json:"id"`
2021-12-08 10:23:00 +01:00
SenderUserId int64 `json:"sender_user_id"`
2021-10-22 16:24:12 +02:00
ChatId int64 `json:"chat_id"`
MessageId int64 `json:"message_id"`
ChatInstance JsonInt64 `json:"chat_instance"`
Payload json.RawMessage `json:"payload"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateNewCallbackQuery.Id = tmp.Id
updateNewCallbackQuery.SenderUserId = tmp.SenderUserId
updateNewCallbackQuery.ChatId = tmp.ChatId
updateNewCallbackQuery.MessageId = tmp.MessageId
updateNewCallbackQuery.ChatInstance = tmp.ChatInstance
fieldPayload, _ := UnmarshalCallbackQueryPayload(tmp.Payload)
updateNewCallbackQuery.Payload = fieldPayload
return nil
}
// A new incoming callback query from a message sent via a bot; for bots only
type UpdateNewInlineCallbackQuery struct {
meta
// Unique query identifier
Id JsonInt64 `json:"id"`
// Identifier of the user who sent the query
2021-12-08 10:23:00 +01:00
SenderUserId int64 `json:"sender_user_id"`
2023-06-04 22:58:07 +02:00
// Identifier of the inline message from which the query originated
2021-10-22 16:24:12 +02:00
InlineMessageId string `json:"inline_message_id"`
// An identifier uniquely corresponding to the chat a message was sent to
ChatInstance JsonInt64 `json:"chat_instance"`
// Query payload
Payload CallbackQueryPayload `json:"payload"`
}
func (entity *UpdateNewInlineCallbackQuery) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewInlineCallbackQuery
return json.Marshal((*stub)(entity))
}
func (*UpdateNewInlineCallbackQuery) GetClass() string {
return ClassUpdate
}
func (*UpdateNewInlineCallbackQuery) GetType() string {
return TypeUpdateNewInlineCallbackQuery
}
func (*UpdateNewInlineCallbackQuery) UpdateType() string {
return TypeUpdateNewInlineCallbackQuery
}
func (updateNewInlineCallbackQuery *UpdateNewInlineCallbackQuery) UnmarshalJSON(data []byte) error {
var tmp struct {
Id JsonInt64 `json:"id"`
2021-12-08 10:23:00 +01:00
SenderUserId int64 `json:"sender_user_id"`
2021-10-22 16:24:12 +02:00
InlineMessageId string `json:"inline_message_id"`
ChatInstance JsonInt64 `json:"chat_instance"`
Payload json.RawMessage `json:"payload"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
updateNewInlineCallbackQuery.Id = tmp.Id
updateNewInlineCallbackQuery.SenderUserId = tmp.SenderUserId
updateNewInlineCallbackQuery.InlineMessageId = tmp.InlineMessageId
updateNewInlineCallbackQuery.ChatInstance = tmp.ChatInstance
fieldPayload, _ := UnmarshalCallbackQueryPayload(tmp.Payload)
updateNewInlineCallbackQuery.Payload = fieldPayload
return nil
}
// A new incoming shipping query; for bots only. Only for invoices with flexible price
type UpdateNewShippingQuery struct {
meta
// Unique query identifier
Id JsonInt64 `json:"id"`
// Identifier of the user who sent the query
2021-12-08 10:23:00 +01:00
SenderUserId int64 `json:"sender_user_id"`
2021-10-22 16:24:12 +02:00
// Invoice payload
InvoicePayload string `json:"invoice_payload"`
// User shipping address
ShippingAddress *Address `json:"shipping_address"`
}
func (entity *UpdateNewShippingQuery) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewShippingQuery
return json.Marshal((*stub)(entity))
}
func (*UpdateNewShippingQuery) GetClass() string {
return ClassUpdate
}
func (*UpdateNewShippingQuery) GetType() string {
return TypeUpdateNewShippingQuery
}
func (*UpdateNewShippingQuery) UpdateType() string {
return TypeUpdateNewShippingQuery
}
// A new incoming pre-checkout query; for bots only. Contains full information about a checkout
type UpdateNewPreCheckoutQuery struct {
meta
// Unique query identifier
Id JsonInt64 `json:"id"`
// Identifier of the user who sent the query
2021-12-08 10:23:00 +01:00
SenderUserId int64 `json:"sender_user_id"`
2021-10-22 16:24:12 +02:00
// Currency for the product price
Currency string `json:"currency"`
2021-12-08 10:23:00 +01:00
// Total price for the product, in the smallest units of the currency
2021-10-22 16:24:12 +02:00
TotalAmount int64 `json:"total_amount"`
// Invoice payload
InvoicePayload []byte `json:"invoice_payload"`
// Identifier of a shipping option chosen by the user; may be empty if not applicable
ShippingOptionId string `json:"shipping_option_id"`
// Information about the order; may be null
OrderInfo *OrderInfo `json:"order_info"`
}
func (entity *UpdateNewPreCheckoutQuery) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewPreCheckoutQuery
return json.Marshal((*stub)(entity))
}
func (*UpdateNewPreCheckoutQuery) GetClass() string {
return ClassUpdate
}
func (*UpdateNewPreCheckoutQuery) GetType() string {
return TypeUpdateNewPreCheckoutQuery
}
func (*UpdateNewPreCheckoutQuery) UpdateType() string {
return TypeUpdateNewPreCheckoutQuery
}
// A new incoming event; for bots only
type UpdateNewCustomEvent struct {
meta
// A JSON-serialized event
Event string `json:"event"`
}
func (entity *UpdateNewCustomEvent) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewCustomEvent
return json.Marshal((*stub)(entity))
}
func (*UpdateNewCustomEvent) GetClass() string {
return ClassUpdate
}
func (*UpdateNewCustomEvent) GetType() string {
return TypeUpdateNewCustomEvent
}
func (*UpdateNewCustomEvent) UpdateType() string {
return TypeUpdateNewCustomEvent
}
// A new incoming query; for bots only
type UpdateNewCustomQuery struct {
meta
// The query identifier
Id JsonInt64 `json:"id"`
// JSON-serialized query data
Data string `json:"data"`
// Query timeout
Timeout int32 `json:"timeout"`
}
func (entity *UpdateNewCustomQuery) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewCustomQuery
return json.Marshal((*stub)(entity))
}
func (*UpdateNewCustomQuery) GetClass() string {
return ClassUpdate
}
func (*UpdateNewCustomQuery) GetType() string {
return TypeUpdateNewCustomQuery
}
func (*UpdateNewCustomQuery) UpdateType() string {
return TypeUpdateNewCustomQuery
}
// A poll was updated; for bots only
type UpdatePoll struct {
meta
// New data about the poll
Poll *Poll `json:"poll"`
}
func (entity *UpdatePoll) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdatePoll
return json.Marshal((*stub)(entity))
}
func (*UpdatePoll) GetClass() string {
return ClassUpdate
}
func (*UpdatePoll) GetType() string {
return TypeUpdatePoll
}
func (*UpdatePoll) UpdateType() string {
return TypeUpdatePoll
}
// A user changed the answer to a poll; for bots only
type UpdatePollAnswer struct {
meta
// Unique poll identifier
PollId JsonInt64 `json:"poll_id"`
// The user, who changed the answer to the poll
2021-12-08 10:23:00 +01:00
UserId int64 `json:"user_id"`
2021-10-22 16:24:12 +02:00
// 0-based identifiers of answer options, chosen by the user
OptionIds []int32 `json:"option_ids"`
}
func (entity *UpdatePollAnswer) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdatePollAnswer
return json.Marshal((*stub)(entity))
}
func (*UpdatePollAnswer) GetClass() string {
return ClassUpdate
}
func (*UpdatePollAnswer) GetType() string {
return TypeUpdatePollAnswer
}
func (*UpdatePollAnswer) UpdateType() string {
return TypeUpdatePollAnswer
}
2021-12-08 10:23:00 +01:00
// User rights changed in a chat; for bots only
type UpdateChatMember struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of the user, changing the rights
ActorUserId int64 `json:"actor_user_id"`
// Point in time (Unix timestamp) when the user rights was changed
Date int32 `json:"date"`
// If user has joined the chat using an invite link, the invite link; may be null
InviteLink *ChatInviteLink `json:"invite_link"`
// Previous chat member
OldChatMember *ChatMember `json:"old_chat_member"`
// New chat member
NewChatMember *ChatMember `json:"new_chat_member"`
}
func (entity *UpdateChatMember) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateChatMember
return json.Marshal((*stub)(entity))
}
func (*UpdateChatMember) GetClass() string {
return ClassUpdate
}
func (*UpdateChatMember) GetType() string {
return TypeUpdateChatMember
}
func (*UpdateChatMember) UpdateType() string {
return TypeUpdateChatMember
}
// A user sent a join request to a chat; for bots only
type UpdateNewChatJoinRequest struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Join request
Request *ChatJoinRequest `json:"request"`
// The invite link, which was used to send join request; may be null
InviteLink *ChatInviteLink `json:"invite_link"`
}
func (entity *UpdateNewChatJoinRequest) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewChatJoinRequest
return json.Marshal((*stub)(entity))
}
func (*UpdateNewChatJoinRequest) GetClass() string {
return ClassUpdate
}
func (*UpdateNewChatJoinRequest) GetType() string {
return TypeUpdateNewChatJoinRequest
}
func (*UpdateNewChatJoinRequest) UpdateType() string {
return TypeUpdateNewChatJoinRequest
}
2021-10-22 16:24:12 +02:00
// Contains a list of updates
type Updates struct {
meta
// List of updates
Updates []Update `json:"updates"`
}
func (entity *Updates) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub Updates
return json.Marshal((*stub)(entity))
}
func (*Updates) GetClass() string {
return ClassUpdates
}
func (*Updates) GetType() string {
return TypeUpdates
}
func (updates *Updates) UnmarshalJSON(data []byte) error {
var tmp struct {
Updates []json.RawMessage `json:"updates"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
fieldUpdates, _ := UnmarshalListOfUpdate(tmp.Updates)
updates.Updates = fieldUpdates
return nil
}
// The log is written to stderr or an OS specific log
type LogStreamDefault struct {
meta
}
func (entity *LogStreamDefault) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub LogStreamDefault
return json.Marshal((*stub)(entity))
}
func (*LogStreamDefault) GetClass() string {
return ClassLogStream
}
func (*LogStreamDefault) GetType() string {
return TypeLogStreamDefault
}
func (*LogStreamDefault) LogStreamType() string {
return TypeLogStreamDefault
}
// The log is written to a file
type LogStreamFile struct {
meta
// Path to the file to where the internal TDLib log will be written
Path string `json:"path"`
2021-12-08 10:23:00 +01:00
// The maximum size of the file to where the internal TDLib log is written before the file will automatically be rotated, in bytes
2021-10-22 16:24:12 +02:00
MaxFileSize int64 `json:"max_file_size"`
// Pass true to additionally redirect stderr to the log file. Ignored on Windows
RedirectStderr bool `json:"redirect_stderr"`
}
func (entity *LogStreamFile) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub LogStreamFile
return json.Marshal((*stub)(entity))
}
func (*LogStreamFile) GetClass() string {
return ClassLogStream
}
func (*LogStreamFile) GetType() string {
return TypeLogStreamFile
}
func (*LogStreamFile) LogStreamType() string {
return TypeLogStreamFile
}
// The log is written nowhere
type LogStreamEmpty struct {
meta
}
func (entity *LogStreamEmpty) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub LogStreamEmpty
return json.Marshal((*stub)(entity))
}
func (*LogStreamEmpty) GetClass() string {
return ClassLogStream
}
func (*LogStreamEmpty) GetType() string {
return TypeLogStreamEmpty
}
func (*LogStreamEmpty) LogStreamType() string {
return TypeLogStreamEmpty
}
// Contains a TDLib internal log verbosity level
type LogVerbosityLevel struct {
meta
// Log verbosity level
VerbosityLevel int32 `json:"verbosity_level"`
}
func (entity *LogVerbosityLevel) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub LogVerbosityLevel
return json.Marshal((*stub)(entity))
}
func (*LogVerbosityLevel) GetClass() string {
return ClassLogVerbosityLevel
}
func (*LogVerbosityLevel) GetType() string {
return TypeLogVerbosityLevel
}
// Contains a list of available TDLib internal log tags
type LogTags struct {
meta
// List of log tags
Tags []string `json:"tags"`
}
func (entity *LogTags) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub LogTags
return json.Marshal((*stub)(entity))
}
func (*LogTags) GetClass() string {
return ClassLogTags
}
func (*LogTags) GetType() string {
return TypeLogTags
}
2023-06-04 22:58:07 +02:00
// Contains custom information about the user
type UserSupportInfo struct {
meta
// Information message
Message *FormattedText `json:"message"`
// Information author
Author string `json:"author"`
// Information change date
Date int32 `json:"date"`
}
func (entity *UserSupportInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UserSupportInfo
return json.Marshal((*stub)(entity))
}
func (*UserSupportInfo) GetClass() string {
return ClassUserSupportInfo
}
func (*UserSupportInfo) GetType() string {
return TypeUserSupportInfo
}
2021-10-22 16:24:12 +02:00
// A simple object containing a number; for testing only
type TestInt struct {
meta
// Number
Value int32 `json:"value"`
}
func (entity *TestInt) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TestInt
return json.Marshal((*stub)(entity))
}
func (*TestInt) GetClass() string {
return ClassTestInt
}
func (*TestInt) GetType() string {
return TypeTestInt
}
// A simple object containing a string; for testing only
type TestString struct {
meta
// String
Value string `json:"value"`
}
func (entity *TestString) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TestString
return json.Marshal((*stub)(entity))
}
func (*TestString) GetClass() string {
return ClassTestString
}
func (*TestString) GetType() string {
return TypeTestString
}
// A simple object containing a sequence of bytes; for testing only
type TestBytes struct {
meta
// Bytes
Value []byte `json:"value"`
}
func (entity *TestBytes) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TestBytes
return json.Marshal((*stub)(entity))
}
func (*TestBytes) GetClass() string {
return ClassTestBytes
}
func (*TestBytes) GetType() string {
return TypeTestBytes
}
// A simple object containing a vector of numbers; for testing only
type TestVectorInt struct {
meta
// Vector of numbers
Value []int32 `json:"value"`
}
func (entity *TestVectorInt) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TestVectorInt
return json.Marshal((*stub)(entity))
}
func (*TestVectorInt) GetClass() string {
return ClassTestVectorInt
}
func (*TestVectorInt) GetType() string {
return TypeTestVectorInt
}
// A simple object containing a vector of objects that hold a number; for testing only
type TestVectorIntObject struct {
meta
// Vector of objects
Value []*TestInt `json:"value"`
}
func (entity *TestVectorIntObject) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TestVectorIntObject
return json.Marshal((*stub)(entity))
}
func (*TestVectorIntObject) GetClass() string {
return ClassTestVectorIntObject
}
func (*TestVectorIntObject) GetType() string {
return TypeTestVectorIntObject
}
// A simple object containing a vector of strings; for testing only
type TestVectorString struct {
meta
// Vector of strings
Value []string `json:"value"`
}
func (entity *TestVectorString) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TestVectorString
return json.Marshal((*stub)(entity))
}
func (*TestVectorString) GetClass() string {
return ClassTestVectorString
}
func (*TestVectorString) GetType() string {
return TypeTestVectorString
}
// A simple object containing a vector of objects that hold a string; for testing only
type TestVectorStringObject struct {
meta
// Vector of objects
Value []*TestString `json:"value"`
}
func (entity *TestVectorStringObject) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TestVectorStringObject
return json.Marshal((*stub)(entity))
}
func (*TestVectorStringObject) GetClass() string {
return ClassTestVectorStringObject
}
func (*TestVectorStringObject) GetType() string {
return TypeTestVectorStringObject
}