49859 lines
1.4 MiB
Executable file
49859 lines
1.4 MiB
Executable file
// AUTOGENERATED
|
|
|
|
package client
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
const (
|
|
ClassAuthenticationCodeType = "AuthenticationCodeType"
|
|
ClassEmailAddressAuthentication = "EmailAddressAuthentication"
|
|
ClassEmailAddressResetState = "EmailAddressResetState"
|
|
ClassAuthorizationState = "AuthorizationState"
|
|
ClassInputFile = "InputFile"
|
|
ClassThumbnailFormat = "ThumbnailFormat"
|
|
ClassMaskPoint = "MaskPoint"
|
|
ClassStickerFormat = "StickerFormat"
|
|
ClassStickerType = "StickerType"
|
|
ClassStickerFullType = "StickerFullType"
|
|
ClassPollType = "PollType"
|
|
ClassUserType = "UserType"
|
|
ClassBusinessAwayMessageSchedule = "BusinessAwayMessageSchedule"
|
|
ClassChatPhotoStickerType = "ChatPhotoStickerType"
|
|
ClassInputChatPhoto = "InputChatPhoto"
|
|
ClassPremiumGiveawayParticipantStatus = "PremiumGiveawayParticipantStatus"
|
|
ClassPremiumGiveawayInfo = "PremiumGiveawayInfo"
|
|
ClassChatMemberStatus = "ChatMemberStatus"
|
|
ClassChatMembersFilter = "ChatMembersFilter"
|
|
ClassSupergroupMembersFilter = "SupergroupMembersFilter"
|
|
ClassInviteLinkChatType = "InviteLinkChatType"
|
|
ClassSecretChatState = "SecretChatState"
|
|
ClassMessageSender = "MessageSender"
|
|
ClassMessageReadDate = "MessageReadDate"
|
|
ClassMessageOrigin = "MessageOrigin"
|
|
ClassReactionType = "ReactionType"
|
|
ClassMessageSendingState = "MessageSendingState"
|
|
ClassMessageReplyTo = "MessageReplyTo"
|
|
ClassInputMessageReplyTo = "InputMessageReplyTo"
|
|
ClassMessageSource = "MessageSource"
|
|
ClassMessageSponsorType = "MessageSponsorType"
|
|
ClassReportChatSponsoredMessageResult = "ReportChatSponsoredMessageResult"
|
|
ClassNotificationSettingsScope = "NotificationSettingsScope"
|
|
ClassChatType = "ChatType"
|
|
ClassChatList = "ChatList"
|
|
ClassChatSource = "ChatSource"
|
|
ClassChatAvailableReactions = "ChatAvailableReactions"
|
|
ClassPublicChatType = "PublicChatType"
|
|
ClassChatActionBar = "ChatActionBar"
|
|
ClassKeyboardButtonType = "KeyboardButtonType"
|
|
ClassInlineKeyboardButtonType = "InlineKeyboardButtonType"
|
|
ClassReplyMarkup = "ReplyMarkup"
|
|
ClassLoginUrlInfo = "LoginUrlInfo"
|
|
ClassSavedMessagesTopicType = "SavedMessagesTopicType"
|
|
ClassRichText = "RichText"
|
|
ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment"
|
|
ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment"
|
|
ClassPageBlock = "PageBlock"
|
|
ClassCollectibleItemType = "CollectibleItemType"
|
|
ClassInputCredentials = "InputCredentials"
|
|
ClassPaymentProvider = "PaymentProvider"
|
|
ClassInputInvoice = "InputInvoice"
|
|
ClassMessageExtendedMedia = "MessageExtendedMedia"
|
|
ClassPassportElementType = "PassportElementType"
|
|
ClassPassportElement = "PassportElement"
|
|
ClassInputPassportElement = "InputPassportElement"
|
|
ClassPassportElementErrorSource = "PassportElementErrorSource"
|
|
ClassInputPassportElementErrorSource = "InputPassportElementErrorSource"
|
|
ClassMessageContent = "MessageContent"
|
|
ClassTextEntityType = "TextEntityType"
|
|
ClassMessageSchedulingState = "MessageSchedulingState"
|
|
ClassMessageSelfDestructType = "MessageSelfDestructType"
|
|
ClassInputMessageContent = "InputMessageContent"
|
|
ClassSearchMessagesFilter = "SearchMessagesFilter"
|
|
ClassChatAction = "ChatAction"
|
|
ClassUserStatus = "UserStatus"
|
|
ClassEmojiCategoryType = "EmojiCategoryType"
|
|
ClassStoryAreaType = "StoryAreaType"
|
|
ClassInputStoryAreaType = "InputStoryAreaType"
|
|
ClassStoryContent = "StoryContent"
|
|
ClassInputStoryContent = "InputStoryContent"
|
|
ClassStoryList = "StoryList"
|
|
ClassStoryOrigin = "StoryOrigin"
|
|
ClassStoryInteractionType = "StoryInteractionType"
|
|
ClassPublicForward = "PublicForward"
|
|
ClassChatBoostSource = "ChatBoostSource"
|
|
ClassCallDiscardReason = "CallDiscardReason"
|
|
ClassCallServerType = "CallServerType"
|
|
ClassCallState = "CallState"
|
|
ClassGroupCallVideoQuality = "GroupCallVideoQuality"
|
|
ClassCallProblem = "CallProblem"
|
|
ClassFirebaseAuthenticationSettings = "FirebaseAuthenticationSettings"
|
|
ClassReactionUnavailabilityReason = "ReactionUnavailabilityReason"
|
|
ClassDiceStickers = "DiceStickers"
|
|
ClassSpeechRecognitionResult = "SpeechRecognitionResult"
|
|
ClassBotWriteAccessAllowReason = "BotWriteAccessAllowReason"
|
|
ClassInputInlineQueryResult = "InputInlineQueryResult"
|
|
ClassInlineQueryResult = "InlineQueryResult"
|
|
ClassInlineQueryResultsButtonType = "InlineQueryResultsButtonType"
|
|
ClassCallbackQueryPayload = "CallbackQueryPayload"
|
|
ClassChatEventAction = "ChatEventAction"
|
|
ClassLanguagePackStringValue = "LanguagePackStringValue"
|
|
ClassPremiumLimitType = "PremiumLimitType"
|
|
ClassPremiumFeature = "PremiumFeature"
|
|
ClassBusinessFeature = "BusinessFeature"
|
|
ClassPremiumStoryFeature = "PremiumStoryFeature"
|
|
ClassPremiumSource = "PremiumSource"
|
|
ClassStorePaymentPurpose = "StorePaymentPurpose"
|
|
ClassTelegramPaymentPurpose = "TelegramPaymentPurpose"
|
|
ClassDeviceToken = "DeviceToken"
|
|
ClassBackgroundFill = "BackgroundFill"
|
|
ClassBackgroundType = "BackgroundType"
|
|
ClassInputBackground = "InputBackground"
|
|
ClassCanSendStoryResult = "CanSendStoryResult"
|
|
ClassCanTransferOwnershipResult = "CanTransferOwnershipResult"
|
|
ClassCheckChatUsernameResult = "CheckChatUsernameResult"
|
|
ClassCheckStickerSetNameResult = "CheckStickerSetNameResult"
|
|
ClassResetPasswordResult = "ResetPasswordResult"
|
|
ClassMessageFileType = "MessageFileType"
|
|
ClassPushMessageContent = "PushMessageContent"
|
|
ClassNotificationType = "NotificationType"
|
|
ClassNotificationGroupType = "NotificationGroupType"
|
|
ClassOptionValue = "OptionValue"
|
|
ClassJsonValue = "JsonValue"
|
|
ClassStoryPrivacySettings = "StoryPrivacySettings"
|
|
ClassUserPrivacySettingRule = "UserPrivacySettingRule"
|
|
ClassUserPrivacySetting = "UserPrivacySetting"
|
|
ClassCanSendMessageToUserResult = "CanSendMessageToUserResult"
|
|
ClassSessionType = "SessionType"
|
|
ClassReportReason = "ReportReason"
|
|
ClassTargetChat = "TargetChat"
|
|
ClassInternalLinkType = "InternalLinkType"
|
|
ClassBlockList = "BlockList"
|
|
ClassFileType = "FileType"
|
|
ClassNetworkType = "NetworkType"
|
|
ClassNetworkStatisticsEntry = "NetworkStatisticsEntry"
|
|
ClassAutosaveSettingsScope = "AutosaveSettingsScope"
|
|
ClassConnectionState = "ConnectionState"
|
|
ClassTopChatCategory = "TopChatCategory"
|
|
ClassTMeUrlType = "TMeUrlType"
|
|
ClassSuggestedAction = "SuggestedAction"
|
|
ClassTextParseMode = "TextParseMode"
|
|
ClassProxyType = "ProxyType"
|
|
ClassStatisticalGraph = "StatisticalGraph"
|
|
ClassChatStatisticsObjectType = "ChatStatisticsObjectType"
|
|
ClassChatStatistics = "ChatStatistics"
|
|
ClassVectorPathCommand = "VectorPathCommand"
|
|
ClassBotCommandScope = "BotCommandScope"
|
|
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"
|
|
ClassClosedVectorPath = "ClosedVectorPath"
|
|
ClassPollOption = "PollOption"
|
|
ClassAnimation = "Animation"
|
|
ClassAudio = "Audio"
|
|
ClassDocument = "Document"
|
|
ClassPhoto = "Photo"
|
|
ClassSticker = "Sticker"
|
|
ClassVideo = "Video"
|
|
ClassVideoNote = "VideoNote"
|
|
ClassVoiceNote = "VoiceNote"
|
|
ClassAnimatedEmoji = "AnimatedEmoji"
|
|
ClassContact = "Contact"
|
|
ClassLocation = "Location"
|
|
ClassVenue = "Venue"
|
|
ClassGame = "Game"
|
|
ClassWebApp = "WebApp"
|
|
ClassPoll = "Poll"
|
|
ClassBackground = "Background"
|
|
ClassBackgrounds = "Backgrounds"
|
|
ClassChatBackground = "ChatBackground"
|
|
ClassProfilePhoto = "ProfilePhoto"
|
|
ClassChatPhotoInfo = "ChatPhotoInfo"
|
|
ClassBotCommand = "BotCommand"
|
|
ClassBotCommands = "BotCommands"
|
|
ClassBotMenuButton = "BotMenuButton"
|
|
ClassChatLocation = "ChatLocation"
|
|
ClassBirthdate = "Birthdate"
|
|
ClassCloseBirthdayUser = "CloseBirthdayUser"
|
|
ClassBusinessLocation = "BusinessLocation"
|
|
ClassBusinessRecipients = "BusinessRecipients"
|
|
ClassBusinessAwayMessageSettings = "BusinessAwayMessageSettings"
|
|
ClassBusinessGreetingMessageSettings = "BusinessGreetingMessageSettings"
|
|
ClassBusinessConnectedBot = "BusinessConnectedBot"
|
|
ClassBusinessIntro = "BusinessIntro"
|
|
ClassInputBusinessIntro = "InputBusinessIntro"
|
|
ClassBusinessOpeningHoursInterval = "BusinessOpeningHoursInterval"
|
|
ClassBusinessOpeningHours = "BusinessOpeningHours"
|
|
ClassBusinessInfo = "BusinessInfo"
|
|
ClassChatPhotoSticker = "ChatPhotoSticker"
|
|
ClassAnimatedChatPhoto = "AnimatedChatPhoto"
|
|
ClassChatPhoto = "ChatPhoto"
|
|
ClassChatPhotos = "ChatPhotos"
|
|
ClassChatPermissions = "ChatPermissions"
|
|
ClassChatAdministratorRights = "ChatAdministratorRights"
|
|
ClassPremiumPaymentOption = "PremiumPaymentOption"
|
|
ClassPremiumStatePaymentOption = "PremiumStatePaymentOption"
|
|
ClassPremiumGiftCodePaymentOption = "PremiumGiftCodePaymentOption"
|
|
ClassPremiumGiftCodePaymentOptions = "PremiumGiftCodePaymentOptions"
|
|
ClassPremiumGiftCodeInfo = "PremiumGiftCodeInfo"
|
|
ClassAccentColor = "AccentColor"
|
|
ClassProfileAccentColors = "ProfileAccentColors"
|
|
ClassProfileAccentColor = "ProfileAccentColor"
|
|
ClassEmojiStatus = "EmojiStatus"
|
|
ClassEmojiStatuses = "EmojiStatuses"
|
|
ClassUsernames = "Usernames"
|
|
ClassUser = "User"
|
|
ClassBotInfo = "BotInfo"
|
|
ClassUserFullInfo = "UserFullInfo"
|
|
ClassUsers = "Users"
|
|
ClassChatAdministrator = "ChatAdministrator"
|
|
ClassChatAdministrators = "ChatAdministrators"
|
|
ClassChatMember = "ChatMember"
|
|
ClassChatMembers = "ChatMembers"
|
|
ClassChatInviteLink = "ChatInviteLink"
|
|
ClassChatInviteLinks = "ChatInviteLinks"
|
|
ClassChatInviteLinkCount = "ChatInviteLinkCount"
|
|
ClassChatInviteLinkCounts = "ChatInviteLinkCounts"
|
|
ClassChatInviteLinkMember = "ChatInviteLinkMember"
|
|
ClassChatInviteLinkMembers = "ChatInviteLinkMembers"
|
|
ClassChatInviteLinkInfo = "ChatInviteLinkInfo"
|
|
ClassChatJoinRequest = "ChatJoinRequest"
|
|
ClassChatJoinRequests = "ChatJoinRequests"
|
|
ClassChatJoinRequestsInfo = "ChatJoinRequestsInfo"
|
|
ClassBasicGroup = "BasicGroup"
|
|
ClassBasicGroupFullInfo = "BasicGroupFullInfo"
|
|
ClassSupergroup = "Supergroup"
|
|
ClassSupergroupFullInfo = "SupergroupFullInfo"
|
|
ClassSecretChat = "SecretChat"
|
|
ClassMessageSenders = "MessageSenders"
|
|
ClassChatMessageSender = "ChatMessageSender"
|
|
ClassChatMessageSenders = "ChatMessageSenders"
|
|
ClassMessageViewer = "MessageViewer"
|
|
ClassMessageViewers = "MessageViewers"
|
|
ClassForwardSource = "ForwardSource"
|
|
ClassMessageForwardInfo = "MessageForwardInfo"
|
|
ClassMessageImportInfo = "MessageImportInfo"
|
|
ClassMessageReplyInfo = "MessageReplyInfo"
|
|
ClassMessageReaction = "MessageReaction"
|
|
ClassMessageReactions = "MessageReactions"
|
|
ClassMessageInteractionInfo = "MessageInteractionInfo"
|
|
ClassUnreadReaction = "UnreadReaction"
|
|
ClassTextQuote = "TextQuote"
|
|
ClassInputTextQuote = "InputTextQuote"
|
|
ClassMessage = "Message"
|
|
ClassMessages = "Messages"
|
|
ClassFoundMessages = "FoundMessages"
|
|
ClassFoundChatMessages = "FoundChatMessages"
|
|
ClassMessagePosition = "MessagePosition"
|
|
ClassMessagePositions = "MessagePositions"
|
|
ClassMessageCalendarDay = "MessageCalendarDay"
|
|
ClassMessageCalendar = "MessageCalendar"
|
|
ClassBusinessMessage = "BusinessMessage"
|
|
ClassBusinessMessages = "BusinessMessages"
|
|
ClassMessageSponsor = "MessageSponsor"
|
|
ClassSponsoredMessage = "SponsoredMessage"
|
|
ClassSponsoredMessages = "SponsoredMessages"
|
|
ClassReportChatSponsoredMessageOption = "ReportChatSponsoredMessageOption"
|
|
ClassFileDownload = "FileDownload"
|
|
ClassDownloadedFileCounts = "DownloadedFileCounts"
|
|
ClassFoundFileDownloads = "FoundFileDownloads"
|
|
ClassChatNotificationSettings = "ChatNotificationSettings"
|
|
ClassScopeNotificationSettings = "ScopeNotificationSettings"
|
|
ClassDraftMessage = "DraftMessage"
|
|
ClassChatFolderIcon = "ChatFolderIcon"
|
|
ClassChatFolder = "ChatFolder"
|
|
ClassChatFolderInfo = "ChatFolderInfo"
|
|
ClassChatFolderInviteLink = "ChatFolderInviteLink"
|
|
ClassChatFolderInviteLinks = "ChatFolderInviteLinks"
|
|
ClassChatFolderInviteLinkInfo = "ChatFolderInviteLinkInfo"
|
|
ClassRecommendedChatFolder = "RecommendedChatFolder"
|
|
ClassRecommendedChatFolders = "RecommendedChatFolders"
|
|
ClassArchiveChatListSettings = "ArchiveChatListSettings"
|
|
ClassChatLists = "ChatLists"
|
|
ClassChatPosition = "ChatPosition"
|
|
ClassSavedMessagesTag = "SavedMessagesTag"
|
|
ClassSavedMessagesTags = "SavedMessagesTags"
|
|
ClassVideoChat = "VideoChat"
|
|
ClassChat = "Chat"
|
|
ClassChats = "Chats"
|
|
ClassChatNearby = "ChatNearby"
|
|
ClassChatsNearby = "ChatsNearby"
|
|
ClassKeyboardButton = "KeyboardButton"
|
|
ClassInlineKeyboardButton = "InlineKeyboardButton"
|
|
ClassFoundWebApp = "FoundWebApp"
|
|
ClassWebAppInfo = "WebAppInfo"
|
|
ClassMessageThreadInfo = "MessageThreadInfo"
|
|
ClassSavedMessagesTopic = "SavedMessagesTopic"
|
|
ClassForumTopicIcon = "ForumTopicIcon"
|
|
ClassForumTopicInfo = "ForumTopicInfo"
|
|
ClassForumTopic = "ForumTopic"
|
|
ClassForumTopics = "ForumTopics"
|
|
ClassLinkPreviewOptions = "LinkPreviewOptions"
|
|
ClassSharedUser = "SharedUser"
|
|
ClassSharedChat = "SharedChat"
|
|
ClassPageBlockCaption = "PageBlockCaption"
|
|
ClassPageBlockListItem = "PageBlockListItem"
|
|
ClassPageBlockTableCell = "PageBlockTableCell"
|
|
ClassPageBlockRelatedArticle = "PageBlockRelatedArticle"
|
|
ClassWebPageInstantView = "WebPageInstantView"
|
|
ClassWebPage = "WebPage"
|
|
ClassCountryInfo = "CountryInfo"
|
|
ClassCountries = "Countries"
|
|
ClassPhoneNumberInfo = "PhoneNumberInfo"
|
|
ClassCollectibleItemInfo = "CollectibleItemInfo"
|
|
ClassBankCardActionOpenUrl = "BankCardActionOpenUrl"
|
|
ClassBankCardInfo = "BankCardInfo"
|
|
ClassAddress = "Address"
|
|
ClassThemeParameters = "ThemeParameters"
|
|
ClassLabeledPricePart = "LabeledPricePart"
|
|
ClassInvoice = "Invoice"
|
|
ClassOrderInfo = "OrderInfo"
|
|
ClassShippingOption = "ShippingOption"
|
|
ClassSavedCredentials = "SavedCredentials"
|
|
ClassPaymentOption = "PaymentOption"
|
|
ClassPaymentForm = "PaymentForm"
|
|
ClassValidatedOrderInfo = "ValidatedOrderInfo"
|
|
ClassPaymentResult = "PaymentResult"
|
|
ClassPaymentReceipt = "PaymentReceipt"
|
|
ClassPremiumGiveawayParameters = "PremiumGiveawayParameters"
|
|
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"
|
|
ClassEmojiKeyword = "EmojiKeyword"
|
|
ClassEmojiKeywords = "EmojiKeywords"
|
|
ClassStickers = "Stickers"
|
|
ClassEmojis = "Emojis"
|
|
ClassStickerSet = "StickerSet"
|
|
ClassStickerSetInfo = "StickerSetInfo"
|
|
ClassStickerSets = "StickerSets"
|
|
ClassTrendingStickerSets = "TrendingStickerSets"
|
|
ClassEmojiCategory = "EmojiCategory"
|
|
ClassEmojiCategories = "EmojiCategories"
|
|
ClassStoryAreaPosition = "StoryAreaPosition"
|
|
ClassStoryArea = "StoryArea"
|
|
ClassInputStoryArea = "InputStoryArea"
|
|
ClassInputStoryAreas = "InputStoryAreas"
|
|
ClassStoryVideo = "StoryVideo"
|
|
ClassStoryRepostInfo = "StoryRepostInfo"
|
|
ClassStoryInteractionInfo = "StoryInteractionInfo"
|
|
ClassStory = "Story"
|
|
ClassStories = "Stories"
|
|
ClassStoryFullId = "StoryFullId"
|
|
ClassStoryInfo = "StoryInfo"
|
|
ClassChatActiveStories = "ChatActiveStories"
|
|
ClassStoryInteraction = "StoryInteraction"
|
|
ClassStoryInteractions = "StoryInteractions"
|
|
ClassQuickReplyMessage = "QuickReplyMessage"
|
|
ClassQuickReplyShortcut = "QuickReplyShortcut"
|
|
ClassPublicForwards = "PublicForwards"
|
|
ClassChatBoostLevelFeatures = "ChatBoostLevelFeatures"
|
|
ClassChatBoostFeatures = "ChatBoostFeatures"
|
|
ClassPrepaidPremiumGiveaway = "PrepaidPremiumGiveaway"
|
|
ClassChatBoostStatus = "ChatBoostStatus"
|
|
ClassChatBoost = "ChatBoost"
|
|
ClassFoundChatBoosts = "FoundChatBoosts"
|
|
ClassChatBoostSlot = "ChatBoostSlot"
|
|
ClassChatBoostSlots = "ChatBoostSlots"
|
|
ClassCallProtocol = "CallProtocol"
|
|
ClassCallServer = "CallServer"
|
|
ClassCallId = "CallId"
|
|
ClassGroupCallId = "GroupCallId"
|
|
ClassGroupCallStream = "GroupCallStream"
|
|
ClassGroupCallStreams = "GroupCallStreams"
|
|
ClassRtmpUrl = "RtmpUrl"
|
|
ClassGroupCallRecentSpeaker = "GroupCallRecentSpeaker"
|
|
ClassGroupCall = "GroupCall"
|
|
ClassGroupCallVideoSourceGroup = "GroupCallVideoSourceGroup"
|
|
ClassGroupCallParticipantVideoInfo = "GroupCallParticipantVideoInfo"
|
|
ClassGroupCallParticipant = "GroupCallParticipant"
|
|
ClassCall = "Call"
|
|
ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings"
|
|
ClassAddedReaction = "AddedReaction"
|
|
ClassAddedReactions = "AddedReactions"
|
|
ClassAvailableReaction = "AvailableReaction"
|
|
ClassAvailableReactions = "AvailableReactions"
|
|
ClassEmojiReaction = "EmojiReaction"
|
|
ClassAnimations = "Animations"
|
|
ClassImportedContacts = "ImportedContacts"
|
|
ClassBusinessConnection = "BusinessConnection"
|
|
ClassAttachmentMenuBotColor = "AttachmentMenuBotColor"
|
|
ClassAttachmentMenuBot = "AttachmentMenuBot"
|
|
ClassSentWebAppMessage = "SentWebAppMessage"
|
|
ClassHttpUrl = "HttpUrl"
|
|
ClassUserLink = "UserLink"
|
|
ClassInlineQueryResultsButton = "InlineQueryResultsButton"
|
|
ClassInlineQueryResults = "InlineQueryResults"
|
|
ClassCallbackQueryAnswer = "CallbackQueryAnswer"
|
|
ClassCustomRequestResult = "CustomRequestResult"
|
|
ClassGameHighScore = "GameHighScore"
|
|
ClassGameHighScores = "GameHighScores"
|
|
ClassChatEvent = "ChatEvent"
|
|
ClassChatEvents = "ChatEvents"
|
|
ClassChatEventLogFilters = "ChatEventLogFilters"
|
|
ClassLanguagePackString = "LanguagePackString"
|
|
ClassLanguagePackStrings = "LanguagePackStrings"
|
|
ClassLanguagePackInfo = "LanguagePackInfo"
|
|
ClassLocalizationTargetInfo = "LocalizationTargetInfo"
|
|
ClassPremiumLimit = "PremiumLimit"
|
|
ClassPremiumFeatures = "PremiumFeatures"
|
|
ClassBusinessFeatures = "BusinessFeatures"
|
|
ClassPremiumFeaturePromotionAnimation = "PremiumFeaturePromotionAnimation"
|
|
ClassBusinessFeaturePromotionAnimation = "BusinessFeaturePromotionAnimation"
|
|
ClassPremiumState = "PremiumState"
|
|
Class//-To = "https://my.telegram.org"
|
|
ClassPushReceiverId = "PushReceiverId"
|
|
ClassThemeSettings = "ThemeSettings"
|
|
ClassChatTheme = "ChatTheme"
|
|
ClassTimeZone = "TimeZone"
|
|
ClassTimeZones = "TimeZones"
|
|
ClassHashtags = "Hashtags"
|
|
ClassNotificationSound = "NotificationSound"
|
|
ClassNotificationSounds = "NotificationSounds"
|
|
ClassNotification = "Notification"
|
|
ClassNotificationGroup = "NotificationGroup"
|
|
ClassJsonObjectMember = "JsonObjectMember"
|
|
ClassUserPrivacySettingRules = "UserPrivacySettingRules"
|
|
ClassReadDatePrivacySettings = "ReadDatePrivacySettings"
|
|
ClassNewChatPrivacySettings = "NewChatPrivacySettings"
|
|
ClassAccountTtl = "AccountTtl"
|
|
ClassMessageAutoDeleteTime = "MessageAutoDeleteTime"
|
|
ClassSession = "Session"
|
|
ClassSessions = "Sessions"
|
|
ClassUnconfirmedSession = "UnconfirmedSession"
|
|
ClassConnectedWebsite = "ConnectedWebsite"
|
|
ClassConnectedWebsites = "ConnectedWebsites"
|
|
ClassMessageLink = "MessageLink"
|
|
ClassMessageLinkInfo = "MessageLinkInfo"
|
|
ClassChatBoostLink = "ChatBoostLink"
|
|
ClassChatBoostLinkInfo = "ChatBoostLinkInfo"
|
|
ClassFilePart = "FilePart"
|
|
ClassStorageStatisticsByFileType = "StorageStatisticsByFileType"
|
|
ClassStorageStatisticsByChat = "StorageStatisticsByChat"
|
|
ClassStorageStatistics = "StorageStatistics"
|
|
ClassStorageStatisticsFast = "StorageStatisticsFast"
|
|
ClassDatabaseStatistics = "DatabaseStatistics"
|
|
ClassNetworkStatistics = "NetworkStatistics"
|
|
ClassAutoDownloadSettings = "AutoDownloadSettings"
|
|
ClassAutoDownloadSettingsPresets = "AutoDownloadSettingsPresets"
|
|
ClassScopeAutosaveSettings = "ScopeAutosaveSettings"
|
|
ClassAutosaveSettingsException = "AutosaveSettingsException"
|
|
ClassAutosaveSettings = "AutosaveSettings"
|
|
ClassFoundPosition = "FoundPosition"
|
|
ClassFoundPositions = "FoundPositions"
|
|
ClassTMeUrl = "TMeUrl"
|
|
ClassTMeUrls = "TMeUrls"
|
|
ClassCount = "Count"
|
|
ClassText = "Text"
|
|
ClassSeconds = "Seconds"
|
|
ClassFileDownloadedPrefixSize = "FileDownloadedPrefixSize"
|
|
ClassDeepLinkInfo = "DeepLinkInfo"
|
|
ClassProxy = "Proxy"
|
|
ClassProxies = "Proxies"
|
|
ClassInputSticker = "InputSticker"
|
|
ClassDateRange = "DateRange"
|
|
ClassStatisticalValue = "StatisticalValue"
|
|
ClassChatStatisticsInteractionInfo = "ChatStatisticsInteractionInfo"
|
|
ClassChatStatisticsMessageSenderInfo = "ChatStatisticsMessageSenderInfo"
|
|
ClassChatStatisticsAdministratorActionsInfo = "ChatStatisticsAdministratorActionsInfo"
|
|
ClassChatStatisticsInviterInfo = "ChatStatisticsInviterInfo"
|
|
ClassMessageStatistics = "MessageStatistics"
|
|
ClassStoryStatistics = "StoryStatistics"
|
|
ClassPoint = "Point"
|
|
ClassUpdates = "Updates"
|
|
ClassLogVerbosityLevel = "LogVerbosityLevel"
|
|
ClassLogTags = "LogTags"
|
|
ClassUserSupportInfo = "UserSupportInfo"
|
|
ClassTestInt = "TestInt"
|
|
ClassTestString = "TestString"
|
|
ClassTestBytes = "TestBytes"
|
|
ClassTestVectorInt = "TestVectorInt"
|
|
ClassTestVectorIntObject = "TestVectorIntObject"
|
|
ClassTestVectorString = "TestVectorString"
|
|
ClassTestVectorStringObject = "TestVectorStringObject"
|
|
)
|
|
|
|
const (
|
|
TypeError = "error"
|
|
TypeOk = "ok"
|
|
TypeAuthenticationCodeTypeTelegramMessage = "authenticationCodeTypeTelegramMessage"
|
|
TypeAuthenticationCodeTypeSms = "authenticationCodeTypeSms"
|
|
TypeAuthenticationCodeTypeCall = "authenticationCodeTypeCall"
|
|
TypeAuthenticationCodeTypeFlashCall = "authenticationCodeTypeFlashCall"
|
|
TypeAuthenticationCodeTypeMissedCall = "authenticationCodeTypeMissedCall"
|
|
TypeAuthenticationCodeTypeFragment = "authenticationCodeTypeFragment"
|
|
TypeAuthenticationCodeTypeFirebaseAndroid = "authenticationCodeTypeFirebaseAndroid"
|
|
TypeAuthenticationCodeTypeFirebaseIos = "authenticationCodeTypeFirebaseIos"
|
|
TypeAuthenticationCodeInfo = "authenticationCodeInfo"
|
|
TypeEmailAddressAuthenticationCodeInfo = "emailAddressAuthenticationCodeInfo"
|
|
TypeEmailAddressAuthenticationCode = "emailAddressAuthenticationCode"
|
|
TypeEmailAddressAuthenticationAppleId = "emailAddressAuthenticationAppleId"
|
|
TypeEmailAddressAuthenticationGoogleId = "emailAddressAuthenticationGoogleId"
|
|
TypeEmailAddressResetStateAvailable = "emailAddressResetStateAvailable"
|
|
TypeEmailAddressResetStatePending = "emailAddressResetStatePending"
|
|
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"
|
|
TypeWebApp = "webApp"
|
|
TypePoll = "poll"
|
|
TypeBackground = "background"
|
|
TypeBackgrounds = "backgrounds"
|
|
TypeChatBackground = "chatBackground"
|
|
TypeProfilePhoto = "profilePhoto"
|
|
TypeChatPhotoInfo = "chatPhotoInfo"
|
|
TypeUserTypeRegular = "userTypeRegular"
|
|
TypeUserTypeDeleted = "userTypeDeleted"
|
|
TypeUserTypeBot = "userTypeBot"
|
|
TypeUserTypeUnknown = "userTypeUnknown"
|
|
TypeBotCommand = "botCommand"
|
|
TypeBotCommands = "botCommands"
|
|
TypeBotMenuButton = "botMenuButton"
|
|
TypeChatLocation = "chatLocation"
|
|
TypeBirthdate = "birthdate"
|
|
TypeCloseBirthdayUser = "closeBirthdayUser"
|
|
TypeBusinessAwayMessageScheduleAlways = "businessAwayMessageScheduleAlways"
|
|
TypeBusinessAwayMessageScheduleOutsideOfOpeningHours = "businessAwayMessageScheduleOutsideOfOpeningHours"
|
|
TypeBusinessAwayMessageScheduleCustom = "businessAwayMessageScheduleCustom"
|
|
TypeBusinessLocation = "businessLocation"
|
|
TypeBusinessRecipients = "businessRecipients"
|
|
TypeBusinessAwayMessageSettings = "businessAwayMessageSettings"
|
|
TypeBusinessGreetingMessageSettings = "businessGreetingMessageSettings"
|
|
TypeBusinessConnectedBot = "businessConnectedBot"
|
|
TypeBusinessIntro = "businessIntro"
|
|
TypeInputBusinessIntro = "inputBusinessIntro"
|
|
TypeBusinessOpeningHoursInterval = "businessOpeningHoursInterval"
|
|
TypeBusinessOpeningHours = "businessOpeningHours"
|
|
TypeBusinessInfo = "businessInfo"
|
|
TypeChatPhotoStickerTypeRegularOrMask = "chatPhotoStickerTypeRegularOrMask"
|
|
TypeChatPhotoStickerTypeCustomEmoji = "chatPhotoStickerTypeCustomEmoji"
|
|
TypeChatPhotoSticker = "chatPhotoSticker"
|
|
TypeAnimatedChatPhoto = "animatedChatPhoto"
|
|
TypeChatPhoto = "chatPhoto"
|
|
TypeChatPhotos = "chatPhotos"
|
|
TypeInputChatPhotoPrevious = "inputChatPhotoPrevious"
|
|
TypeInputChatPhotoStatic = "inputChatPhotoStatic"
|
|
TypeInputChatPhotoAnimation = "inputChatPhotoAnimation"
|
|
TypeInputChatPhotoSticker = "inputChatPhotoSticker"
|
|
TypeChatPermissions = "chatPermissions"
|
|
TypeChatAdministratorRights = "chatAdministratorRights"
|
|
TypePremiumPaymentOption = "premiumPaymentOption"
|
|
TypePremiumStatePaymentOption = "premiumStatePaymentOption"
|
|
TypePremiumGiftCodePaymentOption = "premiumGiftCodePaymentOption"
|
|
TypePremiumGiftCodePaymentOptions = "premiumGiftCodePaymentOptions"
|
|
TypePremiumGiftCodeInfo = "premiumGiftCodeInfo"
|
|
TypePremiumGiveawayParticipantStatusEligible = "premiumGiveawayParticipantStatusEligible"
|
|
TypePremiumGiveawayParticipantStatusParticipating = "premiumGiveawayParticipantStatusParticipating"
|
|
TypePremiumGiveawayParticipantStatusAlreadyWasMember = "premiumGiveawayParticipantStatusAlreadyWasMember"
|
|
TypePremiumGiveawayParticipantStatusAdministrator = "premiumGiveawayParticipantStatusAdministrator"
|
|
TypePremiumGiveawayParticipantStatusDisallowedCountry = "premiumGiveawayParticipantStatusDisallowedCountry"
|
|
TypePremiumGiveawayInfoOngoing = "premiumGiveawayInfoOngoing"
|
|
TypePremiumGiveawayInfoCompleted = "premiumGiveawayInfoCompleted"
|
|
TypeAccentColor = "accentColor"
|
|
TypeProfileAccentColors = "profileAccentColors"
|
|
TypeProfileAccentColor = "profileAccentColor"
|
|
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"
|
|
TypeInviteLinkChatTypeBasicGroup = "inviteLinkChatTypeBasicGroup"
|
|
TypeInviteLinkChatTypeSupergroup = "inviteLinkChatTypeSupergroup"
|
|
TypeInviteLinkChatTypeChannel = "inviteLinkChatTypeChannel"
|
|
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"
|
|
TypeMessageReadDateRead = "messageReadDateRead"
|
|
TypeMessageReadDateUnread = "messageReadDateUnread"
|
|
TypeMessageReadDateTooOld = "messageReadDateTooOld"
|
|
TypeMessageReadDateUserPrivacyRestricted = "messageReadDateUserPrivacyRestricted"
|
|
TypeMessageReadDateMyPrivacyRestricted = "messageReadDateMyPrivacyRestricted"
|
|
TypeMessageViewer = "messageViewer"
|
|
TypeMessageViewers = "messageViewers"
|
|
TypeMessageOriginUser = "messageOriginUser"
|
|
TypeMessageOriginHiddenUser = "messageOriginHiddenUser"
|
|
TypeMessageOriginChat = "messageOriginChat"
|
|
TypeMessageOriginChannel = "messageOriginChannel"
|
|
TypeForwardSource = "forwardSource"
|
|
TypeReactionTypeEmoji = "reactionTypeEmoji"
|
|
TypeReactionTypeCustomEmoji = "reactionTypeCustomEmoji"
|
|
TypeMessageForwardInfo = "messageForwardInfo"
|
|
TypeMessageImportInfo = "messageImportInfo"
|
|
TypeMessageReplyInfo = "messageReplyInfo"
|
|
TypeMessageReaction = "messageReaction"
|
|
TypeMessageReactions = "messageReactions"
|
|
TypeMessageInteractionInfo = "messageInteractionInfo"
|
|
TypeUnreadReaction = "unreadReaction"
|
|
TypeMessageSendingStatePending = "messageSendingStatePending"
|
|
TypeMessageSendingStateFailed = "messageSendingStateFailed"
|
|
TypeTextQuote = "textQuote"
|
|
TypeInputTextQuote = "inputTextQuote"
|
|
TypeMessageReplyToMessage = "messageReplyToMessage"
|
|
TypeMessageReplyToStory = "messageReplyToStory"
|
|
TypeInputMessageReplyToMessage = "inputMessageReplyToMessage"
|
|
TypeInputMessageReplyToStory = "inputMessageReplyToStory"
|
|
TypeMessage = "message"
|
|
TypeMessages = "messages"
|
|
TypeFoundMessages = "foundMessages"
|
|
TypeFoundChatMessages = "foundChatMessages"
|
|
TypeMessagePosition = "messagePosition"
|
|
TypeMessagePositions = "messagePositions"
|
|
TypeMessageCalendarDay = "messageCalendarDay"
|
|
TypeMessageCalendar = "messageCalendar"
|
|
TypeBusinessMessage = "businessMessage"
|
|
TypeBusinessMessages = "businessMessages"
|
|
TypeMessageSourceChatHistory = "messageSourceChatHistory"
|
|
TypeMessageSourceMessageThreadHistory = "messageSourceMessageThreadHistory"
|
|
TypeMessageSourceForumTopicHistory = "messageSourceForumTopicHistory"
|
|
TypeMessageSourceHistoryPreview = "messageSourceHistoryPreview"
|
|
TypeMessageSourceChatList = "messageSourceChatList"
|
|
TypeMessageSourceSearch = "messageSourceSearch"
|
|
TypeMessageSourceChatEventLog = "messageSourceChatEventLog"
|
|
TypeMessageSourceNotification = "messageSourceNotification"
|
|
TypeMessageSourceScreenshot = "messageSourceScreenshot"
|
|
TypeMessageSourceOther = "messageSourceOther"
|
|
TypeMessageSponsorTypeBot = "messageSponsorTypeBot"
|
|
TypeMessageSponsorTypeWebApp = "messageSponsorTypeWebApp"
|
|
TypeMessageSponsorTypePublicChannel = "messageSponsorTypePublicChannel"
|
|
TypeMessageSponsorTypePrivateChannel = "messageSponsorTypePrivateChannel"
|
|
TypeMessageSponsorTypeWebsite = "messageSponsorTypeWebsite"
|
|
TypeMessageSponsor = "messageSponsor"
|
|
TypeSponsoredMessage = "sponsoredMessage"
|
|
TypeSponsoredMessages = "sponsoredMessages"
|
|
TypeReportChatSponsoredMessageOption = "reportChatSponsoredMessageOption"
|
|
TypeReportChatSponsoredMessageResultOk = "reportChatSponsoredMessageResultOk"
|
|
TypeReportChatSponsoredMessageResultFailed = "reportChatSponsoredMessageResultFailed"
|
|
TypeReportChatSponsoredMessageResultOptionRequired = "reportChatSponsoredMessageResultOptionRequired"
|
|
TypeReportChatSponsoredMessageResultAdsHidden = "reportChatSponsoredMessageResultAdsHidden"
|
|
TypeReportChatSponsoredMessageResultPremiumRequired = "reportChatSponsoredMessageResultPremiumRequired"
|
|
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"
|
|
TypeChatFolderIcon = "chatFolderIcon"
|
|
TypeChatFolder = "chatFolder"
|
|
TypeChatFolderInfo = "chatFolderInfo"
|
|
TypeChatFolderInviteLink = "chatFolderInviteLink"
|
|
TypeChatFolderInviteLinks = "chatFolderInviteLinks"
|
|
TypeChatFolderInviteLinkInfo = "chatFolderInviteLinkInfo"
|
|
TypeRecommendedChatFolder = "recommendedChatFolder"
|
|
TypeRecommendedChatFolders = "recommendedChatFolders"
|
|
TypeArchiveChatListSettings = "archiveChatListSettings"
|
|
TypeChatListMain = "chatListMain"
|
|
TypeChatListArchive = "chatListArchive"
|
|
TypeChatListFolder = "chatListFolder"
|
|
TypeChatLists = "chatLists"
|
|
TypeChatSourceMtprotoProxy = "chatSourceMtprotoProxy"
|
|
TypeChatSourcePublicServiceAnnouncement = "chatSourcePublicServiceAnnouncement"
|
|
TypeChatPosition = "chatPosition"
|
|
TypeChatAvailableReactionsAll = "chatAvailableReactionsAll"
|
|
TypeChatAvailableReactionsSome = "chatAvailableReactionsSome"
|
|
TypeSavedMessagesTag = "savedMessagesTag"
|
|
TypeSavedMessagesTags = "savedMessagesTags"
|
|
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"
|
|
TypeKeyboardButtonTypeRequestUsers = "keyboardButtonTypeRequestUsers"
|
|
TypeKeyboardButtonTypeRequestChat = "keyboardButtonTypeRequestChat"
|
|
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"
|
|
TypeFoundWebApp = "foundWebApp"
|
|
TypeWebAppInfo = "webAppInfo"
|
|
TypeMessageThreadInfo = "messageThreadInfo"
|
|
TypeSavedMessagesTopicTypeMyNotes = "savedMessagesTopicTypeMyNotes"
|
|
TypeSavedMessagesTopicTypeAuthorHidden = "savedMessagesTopicTypeAuthorHidden"
|
|
TypeSavedMessagesTopicTypeSavedFromChat = "savedMessagesTopicTypeSavedFromChat"
|
|
TypeSavedMessagesTopic = "savedMessagesTopic"
|
|
TypeForumTopicIcon = "forumTopicIcon"
|
|
TypeForumTopicInfo = "forumTopicInfo"
|
|
TypeForumTopic = "forumTopic"
|
|
TypeForumTopics = "forumTopics"
|
|
TypeLinkPreviewOptions = "linkPreviewOptions"
|
|
TypeSharedUser = "sharedUser"
|
|
TypeSharedChat = "sharedChat"
|
|
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"
|
|
TypeCollectibleItemTypeUsername = "collectibleItemTypeUsername"
|
|
TypeCollectibleItemTypePhoneNumber = "collectibleItemTypePhoneNumber"
|
|
TypeCollectibleItemInfo = "collectibleItemInfo"
|
|
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"
|
|
TypeInputInvoiceTelegram = "inputInvoiceTelegram"
|
|
TypeMessageExtendedMediaPreview = "messageExtendedMediaPreview"
|
|
TypeMessageExtendedMediaPhoto = "messageExtendedMediaPhoto"
|
|
TypeMessageExtendedMediaVideo = "messageExtendedMediaVideo"
|
|
TypeMessageExtendedMediaUnsupported = "messageExtendedMediaUnsupported"
|
|
TypePremiumGiveawayParameters = "premiumGiveawayParameters"
|
|
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"
|
|
TypeMessageSticker = "messageSticker"
|
|
TypeMessageVideo = "messageVideo"
|
|
TypeMessageVideoNote = "messageVideoNote"
|
|
TypeMessageVoiceNote = "messageVoiceNote"
|
|
TypeMessageExpiredPhoto = "messageExpiredPhoto"
|
|
TypeMessageExpiredVideo = "messageExpiredVideo"
|
|
TypeMessageExpiredVideoNote = "messageExpiredVideoNote"
|
|
TypeMessageExpiredVoiceNote = "messageExpiredVoiceNote"
|
|
TypeMessageLocation = "messageLocation"
|
|
TypeMessageVenue = "messageVenue"
|
|
TypeMessageContact = "messageContact"
|
|
TypeMessageAnimatedEmoji = "messageAnimatedEmoji"
|
|
TypeMessageDice = "messageDice"
|
|
TypeMessageGame = "messageGame"
|
|
TypeMessagePoll = "messagePoll"
|
|
TypeMessageStory = "messageStory"
|
|
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"
|
|
TypeMessageChatSetBackground = "messageChatSetBackground"
|
|
TypeMessageChatSetTheme = "messageChatSetTheme"
|
|
TypeMessageChatSetMessageAutoDeleteTime = "messageChatSetMessageAutoDeleteTime"
|
|
TypeMessageChatBoost = "messageChatBoost"
|
|
TypeMessageForumTopicCreated = "messageForumTopicCreated"
|
|
TypeMessageForumTopicEdited = "messageForumTopicEdited"
|
|
TypeMessageForumTopicIsClosedToggled = "messageForumTopicIsClosedToggled"
|
|
TypeMessageForumTopicIsHiddenToggled = "messageForumTopicIsHiddenToggled"
|
|
TypeMessageSuggestProfilePhoto = "messageSuggestProfilePhoto"
|
|
TypeMessageCustomServiceAction = "messageCustomServiceAction"
|
|
TypeMessageGameScore = "messageGameScore"
|
|
TypeMessagePaymentSuccessful = "messagePaymentSuccessful"
|
|
TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot"
|
|
TypeMessageGiftedPremium = "messageGiftedPremium"
|
|
TypeMessagePremiumGiftCode = "messagePremiumGiftCode"
|
|
TypeMessagePremiumGiveawayCreated = "messagePremiumGiveawayCreated"
|
|
TypeMessagePremiumGiveaway = "messagePremiumGiveaway"
|
|
TypeMessagePremiumGiveawayCompleted = "messagePremiumGiveawayCompleted"
|
|
TypeMessagePremiumGiveawayWinners = "messagePremiumGiveawayWinners"
|
|
TypeMessageContactRegistered = "messageContactRegistered"
|
|
TypeMessageUsersShared = "messageUsersShared"
|
|
TypeMessageChatShared = "messageChatShared"
|
|
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"
|
|
TypeTextEntityTypeBlockQuote = "textEntityTypeBlockQuote"
|
|
TypeTextEntityTypeTextUrl = "textEntityTypeTextUrl"
|
|
TypeTextEntityTypeMentionName = "textEntityTypeMentionName"
|
|
TypeTextEntityTypeCustomEmoji = "textEntityTypeCustomEmoji"
|
|
TypeTextEntityTypeMediaTimestamp = "textEntityTypeMediaTimestamp"
|
|
TypeInputThumbnail = "inputThumbnail"
|
|
TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate"
|
|
TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline"
|
|
TypeMessageSelfDestructTypeTimer = "messageSelfDestructTypeTimer"
|
|
TypeMessageSelfDestructTypeImmediately = "messageSelfDestructTypeImmediately"
|
|
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"
|
|
TypeInputMessageStory = "inputMessageStory"
|
|
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"
|
|
TypeEmojiKeyword = "emojiKeyword"
|
|
TypeEmojiKeywords = "emojiKeywords"
|
|
TypeStickers = "stickers"
|
|
TypeEmojis = "emojis"
|
|
TypeStickerSet = "stickerSet"
|
|
TypeStickerSetInfo = "stickerSetInfo"
|
|
TypeStickerSets = "stickerSets"
|
|
TypeTrendingStickerSets = "trendingStickerSets"
|
|
TypeEmojiCategory = "emojiCategory"
|
|
TypeEmojiCategories = "emojiCategories"
|
|
TypeEmojiCategoryTypeDefault = "emojiCategoryTypeDefault"
|
|
TypeEmojiCategoryTypeEmojiStatus = "emojiCategoryTypeEmojiStatus"
|
|
TypeEmojiCategoryTypeChatPhoto = "emojiCategoryTypeChatPhoto"
|
|
TypeStoryAreaPosition = "storyAreaPosition"
|
|
TypeStoryAreaTypeLocation = "storyAreaTypeLocation"
|
|
TypeStoryAreaTypeVenue = "storyAreaTypeVenue"
|
|
TypeStoryAreaTypeSuggestedReaction = "storyAreaTypeSuggestedReaction"
|
|
TypeStoryAreaTypeMessage = "storyAreaTypeMessage"
|
|
TypeStoryArea = "storyArea"
|
|
TypeInputStoryAreaTypeLocation = "inputStoryAreaTypeLocation"
|
|
TypeInputStoryAreaTypeFoundVenue = "inputStoryAreaTypeFoundVenue"
|
|
TypeInputStoryAreaTypePreviousVenue = "inputStoryAreaTypePreviousVenue"
|
|
TypeInputStoryAreaTypeSuggestedReaction = "inputStoryAreaTypeSuggestedReaction"
|
|
TypeInputStoryAreaTypeMessage = "inputStoryAreaTypeMessage"
|
|
TypeInputStoryArea = "inputStoryArea"
|
|
TypeInputStoryAreas = "inputStoryAreas"
|
|
TypeStoryVideo = "storyVideo"
|
|
TypeStoryContentPhoto = "storyContentPhoto"
|
|
TypeStoryContentVideo = "storyContentVideo"
|
|
TypeStoryContentUnsupported = "storyContentUnsupported"
|
|
TypeInputStoryContentPhoto = "inputStoryContentPhoto"
|
|
TypeInputStoryContentVideo = "inputStoryContentVideo"
|
|
TypeStoryListMain = "storyListMain"
|
|
TypeStoryListArchive = "storyListArchive"
|
|
TypeStoryOriginPublicStory = "storyOriginPublicStory"
|
|
TypeStoryOriginHiddenUser = "storyOriginHiddenUser"
|
|
TypeStoryRepostInfo = "storyRepostInfo"
|
|
TypeStoryInteractionInfo = "storyInteractionInfo"
|
|
TypeStory = "story"
|
|
TypeStories = "stories"
|
|
TypeStoryFullId = "storyFullId"
|
|
TypeStoryInfo = "storyInfo"
|
|
TypeChatActiveStories = "chatActiveStories"
|
|
TypeStoryInteractionTypeView = "storyInteractionTypeView"
|
|
TypeStoryInteractionTypeForward = "storyInteractionTypeForward"
|
|
TypeStoryInteractionTypeRepost = "storyInteractionTypeRepost"
|
|
TypeStoryInteraction = "storyInteraction"
|
|
TypeStoryInteractions = "storyInteractions"
|
|
TypeQuickReplyMessage = "quickReplyMessage"
|
|
TypeQuickReplyShortcut = "quickReplyShortcut"
|
|
TypePublicForwardMessage = "publicForwardMessage"
|
|
TypePublicForwardStory = "publicForwardStory"
|
|
TypePublicForwards = "publicForwards"
|
|
TypeChatBoostLevelFeatures = "chatBoostLevelFeatures"
|
|
TypeChatBoostFeatures = "chatBoostFeatures"
|
|
TypeChatBoostSourceGiftCode = "chatBoostSourceGiftCode"
|
|
TypeChatBoostSourceGiveaway = "chatBoostSourceGiveaway"
|
|
TypeChatBoostSourcePremium = "chatBoostSourcePremium"
|
|
TypePrepaidPremiumGiveaway = "prepaidPremiumGiveaway"
|
|
TypeChatBoostStatus = "chatBoostStatus"
|
|
TypeChatBoost = "chatBoost"
|
|
TypeFoundChatBoosts = "foundChatBoosts"
|
|
TypeChatBoostSlot = "chatBoostSlot"
|
|
TypeChatBoostSlots = "chatBoostSlots"
|
|
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"
|
|
TypeFirebaseAuthenticationSettingsAndroid = "firebaseAuthenticationSettingsAndroid"
|
|
TypeFirebaseAuthenticationSettingsIos = "firebaseAuthenticationSettingsIos"
|
|
TypePhoneNumberAuthenticationSettings = "phoneNumberAuthenticationSettings"
|
|
TypeAddedReaction = "addedReaction"
|
|
TypeAddedReactions = "addedReactions"
|
|
TypeAvailableReaction = "availableReaction"
|
|
TypeAvailableReactions = "availableReactions"
|
|
TypeEmojiReaction = "emojiReaction"
|
|
TypeReactionUnavailabilityReasonAnonymousAdministrator = "reactionUnavailabilityReasonAnonymousAdministrator"
|
|
TypeReactionUnavailabilityReasonGuest = "reactionUnavailabilityReasonGuest"
|
|
TypeAnimations = "animations"
|
|
TypeDiceStickersRegular = "diceStickersRegular"
|
|
TypeDiceStickersSlotMachine = "diceStickersSlotMachine"
|
|
TypeImportedContacts = "importedContacts"
|
|
TypeSpeechRecognitionResultPending = "speechRecognitionResultPending"
|
|
TypeSpeechRecognitionResultText = "speechRecognitionResultText"
|
|
TypeSpeechRecognitionResultError = "speechRecognitionResultError"
|
|
TypeBusinessConnection = "businessConnection"
|
|
TypeAttachmentMenuBotColor = "attachmentMenuBotColor"
|
|
TypeAttachmentMenuBot = "attachmentMenuBot"
|
|
TypeSentWebAppMessage = "sentWebAppMessage"
|
|
TypeBotWriteAccessAllowReasonConnectedWebsite = "botWriteAccessAllowReasonConnectedWebsite"
|
|
TypeBotWriteAccessAllowReasonAddedToAttachmentMenu = "botWriteAccessAllowReasonAddedToAttachmentMenu"
|
|
TypeBotWriteAccessAllowReasonLaunchedWebApp = "botWriteAccessAllowReasonLaunchedWebApp"
|
|
TypeBotWriteAccessAllowReasonAcceptedRequest = "botWriteAccessAllowReasonAcceptedRequest"
|
|
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"
|
|
TypeInlineQueryResultsButtonTypeStartBot = "inlineQueryResultsButtonTypeStartBot"
|
|
TypeInlineQueryResultsButtonTypeWebApp = "inlineQueryResultsButtonTypeWebApp"
|
|
TypeInlineQueryResultsButton = "inlineQueryResultsButton"
|
|
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"
|
|
TypeChatEventBackgroundChanged = "chatEventBackgroundChanged"
|
|
TypeChatEventDescriptionChanged = "chatEventDescriptionChanged"
|
|
TypeChatEventEmojiStatusChanged = "chatEventEmojiStatusChanged"
|
|
TypeChatEventLinkedChatChanged = "chatEventLinkedChatChanged"
|
|
TypeChatEventLocationChanged = "chatEventLocationChanged"
|
|
TypeChatEventMessageAutoDeleteTimeChanged = "chatEventMessageAutoDeleteTimeChanged"
|
|
TypeChatEventPermissionsChanged = "chatEventPermissionsChanged"
|
|
TypeChatEventPhotoChanged = "chatEventPhotoChanged"
|
|
TypeChatEventSlowModeDelayChanged = "chatEventSlowModeDelayChanged"
|
|
TypeChatEventStickerSetChanged = "chatEventStickerSetChanged"
|
|
TypeChatEventCustomEmojiStickerSetChanged = "chatEventCustomEmojiStickerSetChanged"
|
|
TypeChatEventTitleChanged = "chatEventTitleChanged"
|
|
TypeChatEventUsernameChanged = "chatEventUsernameChanged"
|
|
TypeChatEventActiveUsernamesChanged = "chatEventActiveUsernamesChanged"
|
|
TypeChatEventAccentColorChanged = "chatEventAccentColorChanged"
|
|
TypeChatEventProfileAccentColorChanged = "chatEventProfileAccentColorChanged"
|
|
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"
|
|
TypePremiumLimitTypeChatFolderCount = "premiumLimitTypeChatFolderCount"
|
|
TypePremiumLimitTypeChatFolderChosenChatCount = "premiumLimitTypeChatFolderChosenChatCount"
|
|
TypePremiumLimitTypePinnedArchivedChatCount = "premiumLimitTypePinnedArchivedChatCount"
|
|
TypePremiumLimitTypePinnedSavedMessagesTopicCount = "premiumLimitTypePinnedSavedMessagesTopicCount"
|
|
TypePremiumLimitTypeCaptionLength = "premiumLimitTypeCaptionLength"
|
|
TypePremiumLimitTypeBioLength = "premiumLimitTypeBioLength"
|
|
TypePremiumLimitTypeChatFolderInviteLinkCount = "premiumLimitTypeChatFolderInviteLinkCount"
|
|
TypePremiumLimitTypeShareableChatFolderCount = "premiumLimitTypeShareableChatFolderCount"
|
|
TypePremiumLimitTypeActiveStoryCount = "premiumLimitTypeActiveStoryCount"
|
|
TypePremiumLimitTypeWeeklySentStoryCount = "premiumLimitTypeWeeklySentStoryCount"
|
|
TypePremiumLimitTypeMonthlySentStoryCount = "premiumLimitTypeMonthlySentStoryCount"
|
|
TypePremiumLimitTypeStoryCaptionLength = "premiumLimitTypeStoryCaptionLength"
|
|
TypePremiumLimitTypeStorySuggestedReactionAreaCount = "premiumLimitTypeStorySuggestedReactionAreaCount"
|
|
TypePremiumLimitTypeSimilarChatCount = "premiumLimitTypeSimilarChatCount"
|
|
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"
|
|
TypePremiumFeatureRealTimeChatTranslation = "premiumFeatureRealTimeChatTranslation"
|
|
TypePremiumFeatureUpgradedStories = "premiumFeatureUpgradedStories"
|
|
TypePremiumFeatureChatBoost = "premiumFeatureChatBoost"
|
|
TypePremiumFeatureAccentColor = "premiumFeatureAccentColor"
|
|
TypePremiumFeatureBackgroundForBoth = "premiumFeatureBackgroundForBoth"
|
|
TypePremiumFeatureSavedMessagesTags = "premiumFeatureSavedMessagesTags"
|
|
TypePremiumFeatureMessagePrivacy = "premiumFeatureMessagePrivacy"
|
|
TypePremiumFeatureLastSeenTimes = "premiumFeatureLastSeenTimes"
|
|
TypePremiumFeatureBusiness = "premiumFeatureBusiness"
|
|
TypeBusinessFeatureLocation = "businessFeatureLocation"
|
|
TypeBusinessFeatureOpeningHours = "businessFeatureOpeningHours"
|
|
TypeBusinessFeatureQuickReplies = "businessFeatureQuickReplies"
|
|
TypeBusinessFeatureGreetingMessage = "businessFeatureGreetingMessage"
|
|
TypeBusinessFeatureAwayMessage = "businessFeatureAwayMessage"
|
|
TypeBusinessFeatureAccountLinks = "businessFeatureAccountLinks"
|
|
TypeBusinessFeatureIntro = "businessFeatureIntro"
|
|
TypeBusinessFeatureBots = "businessFeatureBots"
|
|
TypeBusinessFeatureEmojiStatus = "businessFeatureEmojiStatus"
|
|
TypeBusinessFeatureChatFolderTags = "businessFeatureChatFolderTags"
|
|
TypeBusinessFeatureUpgradedStories = "businessFeatureUpgradedStories"
|
|
TypePremiumStoryFeaturePriorityOrder = "premiumStoryFeaturePriorityOrder"
|
|
TypePremiumStoryFeatureStealthMode = "premiumStoryFeatureStealthMode"
|
|
TypePremiumStoryFeaturePermanentViewsHistory = "premiumStoryFeaturePermanentViewsHistory"
|
|
TypePremiumStoryFeatureCustomExpirationDuration = "premiumStoryFeatureCustomExpirationDuration"
|
|
TypePremiumStoryFeatureSaveStories = "premiumStoryFeatureSaveStories"
|
|
TypePremiumStoryFeatureLinksAndFormatting = "premiumStoryFeatureLinksAndFormatting"
|
|
TypePremiumStoryFeatureVideoQuality = "premiumStoryFeatureVideoQuality"
|
|
TypePremiumLimit = "premiumLimit"
|
|
TypePremiumFeatures = "premiumFeatures"
|
|
TypeBusinessFeatures = "businessFeatures"
|
|
TypePremiumSourceLimitExceeded = "premiumSourceLimitExceeded"
|
|
TypePremiumSourceFeature = "premiumSourceFeature"
|
|
TypePremiumSourceBusinessFeature = "premiumSourceBusinessFeature"
|
|
TypePremiumSourceStoryFeature = "premiumSourceStoryFeature"
|
|
TypePremiumSourceLink = "premiumSourceLink"
|
|
TypePremiumSourceSettings = "premiumSourceSettings"
|
|
TypePremiumFeaturePromotionAnimation = "premiumFeaturePromotionAnimation"
|
|
TypeBusinessFeaturePromotionAnimation = "businessFeaturePromotionAnimation"
|
|
TypePremiumState = "premiumState"
|
|
TypeStorePaymentPurposePremiumSubscription = "storePaymentPurposePremiumSubscription"
|
|
TypeStorePaymentPurposeGiftedPremium = "storePaymentPurposeGiftedPremium"
|
|
TypeStorePaymentPurposePremiumGiftCodes = "storePaymentPurposePremiumGiftCodes"
|
|
TypeStorePaymentPurposePremiumGiveaway = "storePaymentPurposePremiumGiveaway"
|
|
TypeTelegramPaymentPurposePremiumGiftCodes = "telegramPaymentPurposePremiumGiftCodes"
|
|
TypeTelegramPaymentPurposePremiumGiveaway = "telegramPaymentPurposePremiumGiveaway"
|
|
Type//-To = "//-To"
|
|
TypeDeviceTokenFirebaseCloudMessaging = "deviceTokenFirebaseCloudMessaging"
|
|
TypeDeviceTokenApplePush = "deviceTokenApplePush"
|
|
TypeDeviceTokenApplePushVoIP = "deviceTokenApplePushVoIP"
|
|
TypeDeviceTokenWindowsPush = "deviceTokenWindowsPush"
|
|
TypeDeviceTokenMicrosoftPush = "deviceTokenMicrosoftPush"
|
|
TypeDeviceTokenMicrosoftPushVoIP = "deviceTokenMicrosoftPushVoIP"
|
|
TypeDeviceTokenWebPush = "deviceTokenWebPush"
|
|
TypeDeviceTokenSimplePush = "deviceTokenSimplePush"
|
|
TypeDeviceTokenUbuntuPush = "deviceTokenUbuntuPush"
|
|
TypeDeviceTokenBlackBerryPush = "deviceTokenBlackBerryPush"
|
|
TypeDeviceTokenTizenPush = "deviceTokenTizenPush"
|
|
TypeDeviceTokenHuaweiPush = "deviceTokenHuaweiPush"
|
|
TypePushReceiverId = "pushReceiverId"
|
|
TypeBackgroundFillSolid = "backgroundFillSolid"
|
|
TypeBackgroundFillGradient = "backgroundFillGradient"
|
|
TypeBackgroundFillFreeformGradient = "backgroundFillFreeformGradient"
|
|
TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper"
|
|
TypeBackgroundTypePattern = "backgroundTypePattern"
|
|
TypeBackgroundTypeFill = "backgroundTypeFill"
|
|
TypeBackgroundTypeChatTheme = "backgroundTypeChatTheme"
|
|
TypeInputBackgroundLocal = "inputBackgroundLocal"
|
|
TypeInputBackgroundRemote = "inputBackgroundRemote"
|
|
TypeInputBackgroundPrevious = "inputBackgroundPrevious"
|
|
TypeThemeSettings = "themeSettings"
|
|
TypeChatTheme = "chatTheme"
|
|
TypeTimeZone = "timeZone"
|
|
TypeTimeZones = "timeZones"
|
|
TypeHashtags = "hashtags"
|
|
TypeCanSendStoryResultOk = "canSendStoryResultOk"
|
|
TypeCanSendStoryResultPremiumNeeded = "canSendStoryResultPremiumNeeded"
|
|
TypeCanSendStoryResultBoostNeeded = "canSendStoryResultBoostNeeded"
|
|
TypeCanSendStoryResultActiveStoryLimitExceeded = "canSendStoryResultActiveStoryLimitExceeded"
|
|
TypeCanSendStoryResultWeeklyLimitExceeded = "canSendStoryResultWeeklyLimitExceeded"
|
|
TypeCanSendStoryResultMonthlyLimitExceeded = "canSendStoryResultMonthlyLimitExceeded"
|
|
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"
|
|
TypePushMessageContentPremiumGiftCode = "pushMessageContentPremiumGiftCode"
|
|
TypePushMessageContentPremiumGiveaway = "pushMessageContentPremiumGiveaway"
|
|
TypePushMessageContentScreenshotTaken = "pushMessageContentScreenshotTaken"
|
|
TypePushMessageContentSticker = "pushMessageContentSticker"
|
|
TypePushMessageContentStory = "pushMessageContentStory"
|
|
TypePushMessageContentText = "pushMessageContentText"
|
|
TypePushMessageContentVideo = "pushMessageContentVideo"
|
|
TypePushMessageContentVideoNote = "pushMessageContentVideoNote"
|
|
TypePushMessageContentVoiceNote = "pushMessageContentVoiceNote"
|
|
TypePushMessageContentBasicGroupChatCreate = "pushMessageContentBasicGroupChatCreate"
|
|
TypePushMessageContentChatAddMembers = "pushMessageContentChatAddMembers"
|
|
TypePushMessageContentChatChangePhoto = "pushMessageContentChatChangePhoto"
|
|
TypePushMessageContentChatChangeTitle = "pushMessageContentChatChangeTitle"
|
|
TypePushMessageContentChatSetBackground = "pushMessageContentChatSetBackground"
|
|
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"
|
|
TypeStoryPrivacySettingsEveryone = "storyPrivacySettingsEveryone"
|
|
TypeStoryPrivacySettingsContacts = "storyPrivacySettingsContacts"
|
|
TypeStoryPrivacySettingsCloseFriends = "storyPrivacySettingsCloseFriends"
|
|
TypeStoryPrivacySettingsSelectedUsers = "storyPrivacySettingsSelectedUsers"
|
|
TypeUserPrivacySettingRuleAllowAll = "userPrivacySettingRuleAllowAll"
|
|
TypeUserPrivacySettingRuleAllowContacts = "userPrivacySettingRuleAllowContacts"
|
|
TypeUserPrivacySettingRuleAllowPremiumUsers = "userPrivacySettingRuleAllowPremiumUsers"
|
|
TypeUserPrivacySettingRuleAllowUsers = "userPrivacySettingRuleAllowUsers"
|
|
TypeUserPrivacySettingRuleAllowChatMembers = "userPrivacySettingRuleAllowChatMembers"
|
|
TypeUserPrivacySettingRuleRestrictAll = "userPrivacySettingRuleRestrictAll"
|
|
TypeUserPrivacySettingRuleRestrictContacts = "userPrivacySettingRuleRestrictContacts"
|
|
TypeUserPrivacySettingRuleRestrictUsers = "userPrivacySettingRuleRestrictUsers"
|
|
TypeUserPrivacySettingRuleRestrictChatMembers = "userPrivacySettingRuleRestrictChatMembers"
|
|
TypeUserPrivacySettingRules = "userPrivacySettingRules"
|
|
TypeUserPrivacySettingShowStatus = "userPrivacySettingShowStatus"
|
|
TypeUserPrivacySettingShowProfilePhoto = "userPrivacySettingShowProfilePhoto"
|
|
TypeUserPrivacySettingShowLinkInForwardedMessages = "userPrivacySettingShowLinkInForwardedMessages"
|
|
TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber"
|
|
TypeUserPrivacySettingShowBio = "userPrivacySettingShowBio"
|
|
TypeUserPrivacySettingShowBirthdate = "userPrivacySettingShowBirthdate"
|
|
TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites"
|
|
TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls"
|
|
TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls"
|
|
TypeUserPrivacySettingAllowFindingByPhoneNumber = "userPrivacySettingAllowFindingByPhoneNumber"
|
|
TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages"
|
|
TypeReadDatePrivacySettings = "readDatePrivacySettings"
|
|
TypeNewChatPrivacySettings = "newChatPrivacySettings"
|
|
TypeCanSendMessageToUserResultOk = "canSendMessageToUserResultOk"
|
|
TypeCanSendMessageToUserResultUserIsDeleted = "canSendMessageToUserResultUserIsDeleted"
|
|
TypeCanSendMessageToUserResultUserRestrictsNewChats = "canSendMessageToUserResultUserRestrictsNewChats"
|
|
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"
|
|
TypeUnconfirmedSession = "unconfirmedSession"
|
|
TypeConnectedWebsite = "connectedWebsite"
|
|
TypeConnectedWebsites = "connectedWebsites"
|
|
TypeReportReasonSpam = "reportReasonSpam"
|
|
TypeReportReasonViolence = "reportReasonViolence"
|
|
TypeReportReasonPornography = "reportReasonPornography"
|
|
TypeReportReasonChildAbuse = "reportReasonChildAbuse"
|
|
TypeReportReasonCopyright = "reportReasonCopyright"
|
|
TypeReportReasonUnrelatedLocation = "reportReasonUnrelatedLocation"
|
|
TypeReportReasonFake = "reportReasonFake"
|
|
TypeReportReasonIllegalDrugs = "reportReasonIllegalDrugs"
|
|
TypeReportReasonPersonalDetails = "reportReasonPersonalDetails"
|
|
TypeReportReasonCustom = "reportReasonCustom"
|
|
TypeTargetChatCurrent = "targetChatCurrent"
|
|
TypeTargetChatChosen = "targetChatChosen"
|
|
TypeTargetChatInternalLink = "targetChatInternalLink"
|
|
TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions"
|
|
TypeInternalLinkTypeAttachmentMenuBot = "internalLinkTypeAttachmentMenuBot"
|
|
TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode"
|
|
TypeInternalLinkTypeBackground = "internalLinkTypeBackground"
|
|
TypeInternalLinkTypeBotAddToChannel = "internalLinkTypeBotAddToChannel"
|
|
TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart"
|
|
TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup"
|
|
TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber"
|
|
TypeInternalLinkTypeChatBoost = "internalLinkTypeChatBoost"
|
|
TypeInternalLinkTypeChatFolderInvite = "internalLinkTypeChatFolderInvite"
|
|
TypeInternalLinkTypeChatFolderSettings = "internalLinkTypeChatFolderSettings"
|
|
TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite"
|
|
TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings"
|
|
TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings"
|
|
TypeInternalLinkTypeGame = "internalLinkTypeGame"
|
|
TypeInternalLinkTypeInstantView = "internalLinkTypeInstantView"
|
|
TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice"
|
|
TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack"
|
|
TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings"
|
|
TypeInternalLinkTypeMessage = "internalLinkTypeMessage"
|
|
TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft"
|
|
TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest"
|
|
TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation"
|
|
TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures"
|
|
TypeInternalLinkTypePremiumGift = "internalLinkTypePremiumGift"
|
|
TypeInternalLinkTypePremiumGiftCode = "internalLinkTypePremiumGiftCode"
|
|
TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings"
|
|
TypeInternalLinkTypeProxy = "internalLinkTypeProxy"
|
|
TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat"
|
|
TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication"
|
|
TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases"
|
|
TypeInternalLinkTypeSettings = "internalLinkTypeSettings"
|
|
TypeInternalLinkTypeSideMenuBot = "internalLinkTypeSideMenuBot"
|
|
TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet"
|
|
TypeInternalLinkTypeStory = "internalLinkTypeStory"
|
|
TypeInternalLinkTypeTheme = "internalLinkTypeTheme"
|
|
TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings"
|
|
TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink"
|
|
TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy"
|
|
TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber"
|
|
TypeInternalLinkTypeUserToken = "internalLinkTypeUserToken"
|
|
TypeInternalLinkTypeVideoChat = "internalLinkTypeVideoChat"
|
|
TypeInternalLinkTypeWebApp = "internalLinkTypeWebApp"
|
|
TypeMessageLink = "messageLink"
|
|
TypeMessageLinkInfo = "messageLinkInfo"
|
|
TypeChatBoostLink = "chatBoostLink"
|
|
TypeChatBoostLinkInfo = "chatBoostLinkInfo"
|
|
TypeBlockListMain = "blockListMain"
|
|
TypeBlockListStories = "blockListStories"
|
|
TypeFilePart = "filePart"
|
|
TypeFileTypeNone = "fileTypeNone"
|
|
TypeFileTypeAnimation = "fileTypeAnimation"
|
|
TypeFileTypeAudio = "fileTypeAudio"
|
|
TypeFileTypeDocument = "fileTypeDocument"
|
|
TypeFileTypeNotificationSound = "fileTypeNotificationSound"
|
|
TypeFileTypePhoto = "fileTypePhoto"
|
|
TypeFileTypePhotoStory = "fileTypePhotoStory"
|
|
TypeFileTypeProfilePhoto = "fileTypeProfilePhoto"
|
|
TypeFileTypeSecret = "fileTypeSecret"
|
|
TypeFileTypeSecretThumbnail = "fileTypeSecretThumbnail"
|
|
TypeFileTypeSecure = "fileTypeSecure"
|
|
TypeFileTypeSticker = "fileTypeSticker"
|
|
TypeFileTypeThumbnail = "fileTypeThumbnail"
|
|
TypeFileTypeUnknown = "fileTypeUnknown"
|
|
TypeFileTypeVideo = "fileTypeVideo"
|
|
TypeFileTypeVideoNote = "fileTypeVideoNote"
|
|
TypeFileTypeVideoStory = "fileTypeVideoStory"
|
|
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"
|
|
TypeAutosaveSettingsScopePrivateChats = "autosaveSettingsScopePrivateChats"
|
|
TypeAutosaveSettingsScopeGroupChats = "autosaveSettingsScopeGroupChats"
|
|
TypeAutosaveSettingsScopeChannelChats = "autosaveSettingsScopeChannelChats"
|
|
TypeAutosaveSettingsScopeChat = "autosaveSettingsScopeChat"
|
|
TypeScopeAutosaveSettings = "scopeAutosaveSettings"
|
|
TypeAutosaveSettingsException = "autosaveSettingsException"
|
|
TypeAutosaveSettings = "autosaveSettings"
|
|
TypeConnectionStateWaitingForNetwork = "connectionStateWaitingForNetwork"
|
|
TypeConnectionStateConnectingToProxy = "connectionStateConnectingToProxy"
|
|
TypeConnectionStateConnecting = "connectionStateConnecting"
|
|
TypeConnectionStateUpdating = "connectionStateUpdating"
|
|
TypeConnectionStateReady = "connectionStateReady"
|
|
TypeTopChatCategoryUsers = "topChatCategoryUsers"
|
|
TypeTopChatCategoryBots = "topChatCategoryBots"
|
|
TypeTopChatCategoryGroups = "topChatCategoryGroups"
|
|
TypeTopChatCategoryChannels = "topChatCategoryChannels"
|
|
TypeTopChatCategoryInlineBots = "topChatCategoryInlineBots"
|
|
TypeTopChatCategoryCalls = "topChatCategoryCalls"
|
|
TypeTopChatCategoryForwardChats = "topChatCategoryForwardChats"
|
|
TypeFoundPosition = "foundPosition"
|
|
TypeFoundPositions = "foundPositions"
|
|
TypeTMeUrlTypeUser = "tMeUrlTypeUser"
|
|
TypeTMeUrlTypeSupergroup = "tMeUrlTypeSupergroup"
|
|
TypeTMeUrlTypeChatInvite = "tMeUrlTypeChatInvite"
|
|
TypeTMeUrlTypeStickerSet = "tMeUrlTypeStickerSet"
|
|
TypeTMeUrl = "tMeUrl"
|
|
TypeTMeUrls = "tMeUrls"
|
|
TypeSuggestedActionEnableArchiveAndMuteNewChats = "suggestedActionEnableArchiveAndMuteNewChats"
|
|
TypeSuggestedActionCheckPassword = "suggestedActionCheckPassword"
|
|
TypeSuggestedActionCheckPhoneNumber = "suggestedActionCheckPhoneNumber"
|
|
TypeSuggestedActionViewChecksHint = "suggestedActionViewChecksHint"
|
|
TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup"
|
|
TypeSuggestedActionSetPassword = "suggestedActionSetPassword"
|
|
TypeSuggestedActionUpgradePremium = "suggestedActionUpgradePremium"
|
|
TypeSuggestedActionRestorePremium = "suggestedActionRestorePremium"
|
|
TypeSuggestedActionSubscribeToAnnualPremium = "suggestedActionSubscribeToAnnualPremium"
|
|
TypeSuggestedActionGiftPremiumForChristmas = "suggestedActionGiftPremiumForChristmas"
|
|
TypeSuggestedActionSetBirthdate = "suggestedActionSetBirthdate"
|
|
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"
|
|
TypeChatStatisticsObjectTypeMessage = "chatStatisticsObjectTypeMessage"
|
|
TypeChatStatisticsObjectTypeStory = "chatStatisticsObjectTypeStory"
|
|
TypeChatStatisticsInteractionInfo = "chatStatisticsInteractionInfo"
|
|
TypeChatStatisticsMessageSenderInfo = "chatStatisticsMessageSenderInfo"
|
|
TypeChatStatisticsAdministratorActionsInfo = "chatStatisticsAdministratorActionsInfo"
|
|
TypeChatStatisticsInviterInfo = "chatStatisticsInviterInfo"
|
|
TypeChatStatisticsSupergroup = "chatStatisticsSupergroup"
|
|
TypeChatStatisticsChannel = "chatStatisticsChannel"
|
|
TypeMessageStatistics = "messageStatistics"
|
|
TypeStoryStatistics = "storyStatistics"
|
|
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"
|
|
TypeUpdateChatAccentColors = "updateChatAccentColors"
|
|
TypeUpdateChatPermissions = "updateChatPermissions"
|
|
TypeUpdateChatLastMessage = "updateChatLastMessage"
|
|
TypeUpdateChatPosition = "updateChatPosition"
|
|
TypeUpdateChatAddedToList = "updateChatAddedToList"
|
|
TypeUpdateChatRemovedFromList = "updateChatRemovedFromList"
|
|
TypeUpdateChatReadInbox = "updateChatReadInbox"
|
|
TypeUpdateChatReadOutbox = "updateChatReadOutbox"
|
|
TypeUpdateChatActionBar = "updateChatActionBar"
|
|
TypeUpdateChatAvailableReactions = "updateChatAvailableReactions"
|
|
TypeUpdateChatDraftMessage = "updateChatDraftMessage"
|
|
TypeUpdateChatEmojiStatus = "updateChatEmojiStatus"
|
|
TypeUpdateChatMessageSender = "updateChatMessageSender"
|
|
TypeUpdateChatMessageAutoDeleteTime = "updateChatMessageAutoDeleteTime"
|
|
TypeUpdateChatNotificationSettings = "updateChatNotificationSettings"
|
|
TypeUpdateChatPendingJoinRequests = "updateChatPendingJoinRequests"
|
|
TypeUpdateChatReplyMarkup = "updateChatReplyMarkup"
|
|
TypeUpdateChatBackground = "updateChatBackground"
|
|
TypeUpdateChatTheme = "updateChatTheme"
|
|
TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount"
|
|
TypeUpdateChatUnreadReactionCount = "updateChatUnreadReactionCount"
|
|
TypeUpdateChatVideoChat = "updateChatVideoChat"
|
|
TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification"
|
|
TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent"
|
|
TypeUpdateChatIsTranslatable = "updateChatIsTranslatable"
|
|
TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread"
|
|
TypeUpdateChatViewAsTopics = "updateChatViewAsTopics"
|
|
TypeUpdateChatBlockList = "updateChatBlockList"
|
|
TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages"
|
|
TypeUpdateChatFolders = "updateChatFolders"
|
|
TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount"
|
|
TypeUpdateSavedMessagesTopic = "updateSavedMessagesTopic"
|
|
TypeUpdateSavedMessagesTopicCount = "updateSavedMessagesTopicCount"
|
|
TypeUpdateQuickReplyShortcut = "updateQuickReplyShortcut"
|
|
TypeUpdateQuickReplyShortcutDeleted = "updateQuickReplyShortcutDeleted"
|
|
TypeUpdateQuickReplyShortcuts = "updateQuickReplyShortcuts"
|
|
TypeUpdateQuickReplyShortcutMessages = "updateQuickReplyShortcutMessages"
|
|
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"
|
|
TypeUpdateStory = "updateStory"
|
|
TypeUpdateStoryDeleted = "updateStoryDeleted"
|
|
TypeUpdateStorySendSucceeded = "updateStorySendSucceeded"
|
|
TypeUpdateStorySendFailed = "updateStorySendFailed"
|
|
TypeUpdateChatActiveStories = "updateChatActiveStories"
|
|
TypeUpdateStoryListChatCount = "updateStoryListChatCount"
|
|
TypeUpdateStoryStealthMode = "updateStoryStealthMode"
|
|
TypeUpdateOption = "updateOption"
|
|
TypeUpdateStickerSet = "updateStickerSet"
|
|
TypeUpdateInstalledStickerSets = "updateInstalledStickerSets"
|
|
TypeUpdateTrendingStickerSets = "updateTrendingStickerSets"
|
|
TypeUpdateRecentStickers = "updateRecentStickers"
|
|
TypeUpdateFavoriteStickers = "updateFavoriteStickers"
|
|
TypeUpdateSavedAnimations = "updateSavedAnimations"
|
|
TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds"
|
|
TypeUpdateDefaultBackground = "updateDefaultBackground"
|
|
TypeUpdateChatThemes = "updateChatThemes"
|
|
TypeUpdateAccentColors = "updateAccentColors"
|
|
TypeUpdateProfileAccentColors = "updateProfileAccentColors"
|
|
TypeUpdateLanguagePackStrings = "updateLanguagePackStrings"
|
|
TypeUpdateConnectionState = "updateConnectionState"
|
|
TypeUpdateTermsOfService = "updateTermsOfService"
|
|
TypeUpdateUsersNearby = "updateUsersNearby"
|
|
TypeUpdateUnconfirmedSession = "updateUnconfirmedSession"
|
|
TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots"
|
|
TypeUpdateWebAppMessageSent = "updateWebAppMessageSent"
|
|
TypeUpdateActiveEmojiReactions = "updateActiveEmojiReactions"
|
|
TypeUpdateDefaultReactionType = "updateDefaultReactionType"
|
|
TypeUpdateSavedMessagesTags = "updateSavedMessagesTags"
|
|
TypeUpdateSpeechRecognitionTrial = "updateSpeechRecognitionTrial"
|
|
TypeUpdateDiceEmojis = "updateDiceEmojis"
|
|
TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked"
|
|
TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters"
|
|
TypeUpdateSuggestedActions = "updateSuggestedActions"
|
|
TypeUpdateContactCloseBirthdays = "updateContactCloseBirthdays"
|
|
TypeUpdateAddChatMembersPrivacyForbidden = "updateAddChatMembersPrivacyForbidden"
|
|
TypeUpdateAutosaveSettings = "updateAutosaveSettings"
|
|
TypeUpdateBusinessConnection = "updateBusinessConnection"
|
|
TypeUpdateNewBusinessMessage = "updateNewBusinessMessage"
|
|
TypeUpdateBusinessMessageEdited = "updateBusinessMessageEdited"
|
|
TypeUpdateBusinessMessagesDeleted = "updateBusinessMessagesDeleted"
|
|
TypeUpdateNewInlineQuery = "updateNewInlineQuery"
|
|
TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult"
|
|
TypeUpdateNewCallbackQuery = "updateNewCallbackQuery"
|
|
TypeUpdateNewInlineCallbackQuery = "updateNewInlineCallbackQuery"
|
|
TypeUpdateNewShippingQuery = "updateNewShippingQuery"
|
|
TypeUpdateNewPreCheckoutQuery = "updateNewPreCheckoutQuery"
|
|
TypeUpdateNewCustomEvent = "updateNewCustomEvent"
|
|
TypeUpdateNewCustomQuery = "updateNewCustomQuery"
|
|
TypeUpdatePoll = "updatePoll"
|
|
TypeUpdatePollAnswer = "updatePollAnswer"
|
|
TypeUpdateChatMember = "updateChatMember"
|
|
TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest"
|
|
TypeUpdateChatBoost = "updateChatBoost"
|
|
TypeUpdateMessageReaction = "updateMessageReaction"
|
|
TypeUpdateMessageReactions = "updateMessageReactions"
|
|
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"
|
|
)
|
|
|
|
// Provides information about the method by which an authentication code is delivered to the user
|
|
type AuthenticationCodeType interface {
|
|
AuthenticationCodeTypeType() string
|
|
}
|
|
|
|
// Contains authentication data for a email address
|
|
type EmailAddressAuthentication interface {
|
|
EmailAddressAuthenticationType() string
|
|
}
|
|
|
|
// Describes reset state of a email address
|
|
type EmailAddressResetState interface {
|
|
EmailAddressResetStateType() string
|
|
}
|
|
|
|
// Represents the current authorization state of the TDLib client
|
|
type AuthorizationState interface {
|
|
AuthorizationStateType() string
|
|
}
|
|
|
|
// Points to a file
|
|
type InputFile interface {
|
|
InputFileType() string
|
|
}
|
|
|
|
// Describes format of a thumbnail
|
|
type ThumbnailFormat interface {
|
|
ThumbnailFormatType() string
|
|
}
|
|
|
|
// Part of the face, relative to which a mask is placed
|
|
type MaskPoint interface {
|
|
MaskPointType() string
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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 conditions for sending of away messages by a Telegram Business account
|
|
type BusinessAwayMessageSchedule interface {
|
|
BusinessAwayMessageScheduleType() string
|
|
}
|
|
|
|
// Describes type of a sticker, which was used to create a chat photo
|
|
type ChatPhotoStickerType interface {
|
|
ChatPhotoStickerTypeType() string
|
|
}
|
|
|
|
// Describes a photo to be set as a user profile or chat photo
|
|
type InputChatPhoto interface {
|
|
InputChatPhotoType() string
|
|
}
|
|
|
|
// Contains information about status of a user in a Telegram Premium giveaway
|
|
type PremiumGiveawayParticipantStatus interface {
|
|
PremiumGiveawayParticipantStatusType() string
|
|
}
|
|
|
|
// Contains information about Telegram Premium giveaway
|
|
type PremiumGiveawayInfo interface {
|
|
PremiumGiveawayInfoType() 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 type of a chat to which points an invite link
|
|
type InviteLinkChatType interface {
|
|
InviteLinkChatTypeType() 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
|
|
}
|
|
|
|
// Describes read date of a recent outgoing message in a private chat
|
|
type MessageReadDate interface {
|
|
MessageReadDateType() string
|
|
}
|
|
|
|
// Contains information about the origin of a message
|
|
type MessageOrigin interface {
|
|
MessageOriginType() string
|
|
}
|
|
|
|
// Describes type of message reaction
|
|
type ReactionType interface {
|
|
ReactionTypeType() string
|
|
}
|
|
|
|
// Contains information about the sending state of the message
|
|
type MessageSendingState interface {
|
|
MessageSendingStateType() string
|
|
}
|
|
|
|
// Contains information about the message or the story a message is replying to
|
|
type MessageReplyTo interface {
|
|
MessageReplyToType() string
|
|
}
|
|
|
|
// Contains information about the message or the story to be replied
|
|
type InputMessageReplyTo interface {
|
|
InputMessageReplyToType() string
|
|
}
|
|
|
|
// Describes source of a message
|
|
type MessageSource interface {
|
|
MessageSourceType() string
|
|
}
|
|
|
|
// Describes type of a message sponsor
|
|
type MessageSponsorType interface {
|
|
MessageSponsorTypeType() string
|
|
}
|
|
|
|
// Describes result of sponsored message report
|
|
type ReportChatSponsoredMessageResult interface {
|
|
ReportChatSponsoredMessageResultType() string
|
|
}
|
|
|
|
// Describes the types of chats to which notification settings are relevant
|
|
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
|
|
}
|
|
|
|
// Describes reactions available in the chat
|
|
type ChatAvailableReactions interface {
|
|
ChatAvailableReactionsType() string
|
|
}
|
|
|
|
// Describes a type of public chats
|
|
type PublicChatType interface {
|
|
PublicChatTypeType() string
|
|
}
|
|
|
|
// Describes actions which must be possible to do through a chat action bar
|
|
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 type of a Saved Messages topic
|
|
type SavedMessagesTopicType interface {
|
|
SavedMessagesTopicTypeType() 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
|
|
}
|
|
|
|
// Describes a collectible item that can be purchased at https://fragment.com
|
|
type CollectibleItemType interface {
|
|
CollectibleItemTypeType() string
|
|
}
|
|
|
|
// Contains information about the payment method chosen by the user
|
|
type InputCredentials interface {
|
|
InputCredentialsType() string
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// Describes when a message will be self-destructed
|
|
type MessageSelfDestructType interface {
|
|
MessageSelfDestructTypeType() 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 type of an emoji category
|
|
type EmojiCategoryType interface {
|
|
EmojiCategoryTypeType() string
|
|
}
|
|
|
|
// Describes type of a clickable rectangle area on a story media
|
|
type StoryAreaType interface {
|
|
StoryAreaTypeType() string
|
|
}
|
|
|
|
// Describes type of a clickable rectangle area on a story media to be added
|
|
type InputStoryAreaType interface {
|
|
InputStoryAreaTypeType() string
|
|
}
|
|
|
|
// Contains the content of a story
|
|
type StoryContent interface {
|
|
StoryContentType() string
|
|
}
|
|
|
|
// The content of a story to send
|
|
type InputStoryContent interface {
|
|
InputStoryContentType() string
|
|
}
|
|
|
|
// Describes a list of stories
|
|
type StoryList interface {
|
|
StoryListType() string
|
|
}
|
|
|
|
// Contains information about the origin of a story that was reposted
|
|
type StoryOrigin interface {
|
|
StoryOriginType() string
|
|
}
|
|
|
|
// Describes type of interaction with a story
|
|
type StoryInteractionType interface {
|
|
StoryInteractionTypeType() string
|
|
}
|
|
|
|
// Describes a public forward or repost of a story
|
|
type PublicForward interface {
|
|
PublicForwardType() string
|
|
}
|
|
|
|
// Describes source of a chat boost
|
|
type ChatBoostSource interface {
|
|
ChatBoostSourceType() 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
|
|
}
|
|
|
|
// Describes the quality of a group call video
|
|
type GroupCallVideoQuality interface {
|
|
GroupCallVideoQualityType() string
|
|
}
|
|
|
|
// Describes the exact type of a problem with a call
|
|
type CallProblem interface {
|
|
CallProblemType() string
|
|
}
|
|
|
|
// Contains settings for Firebase Authentication in the official applications
|
|
type FirebaseAuthenticationSettings interface {
|
|
FirebaseAuthenticationSettingsType() string
|
|
}
|
|
|
|
// Describes why the current user can't add reactions to the message, despite some other users can
|
|
type ReactionUnavailabilityReason interface {
|
|
ReactionUnavailabilityReasonType() string
|
|
}
|
|
|
|
// Contains animated stickers which must be used for dice animation rendering
|
|
type DiceStickers interface {
|
|
DiceStickersType() string
|
|
}
|
|
|
|
// Describes result of speech recognition in a voice note
|
|
type SpeechRecognitionResult interface {
|
|
SpeechRecognitionResultType() string
|
|
}
|
|
|
|
// Describes a reason why a bot was allowed to write messages to the current user
|
|
type BotWriteAccessAllowReason interface {
|
|
BotWriteAccessAllowReasonType() string
|
|
}
|
|
|
|
// 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 type of a button in results of inline query
|
|
type InlineQueryResultsButtonType interface {
|
|
InlineQueryResultsButtonTypeType() 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
|
|
}
|
|
|
|
// 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 feature available to Business user accounts
|
|
type BusinessFeature interface {
|
|
BusinessFeatureType() string
|
|
}
|
|
|
|
// Describes a story feature available to Premium users
|
|
type PremiumStoryFeature interface {
|
|
PremiumStoryFeatureType() 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
|
|
}
|
|
|
|
// Describes a purpose of a payment toward Telegram
|
|
type TelegramPaymentPurpose interface {
|
|
TelegramPaymentPurposeType() string
|
|
}
|
|
|
|
// Represents a data needed to subscribe for push notifications through registerDevice method.
|
|
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 user can send a story in the specific chat
|
|
type CanSendStoryResult interface {
|
|
CanSendStoryResultType() 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
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// Describes privacy settings of a story
|
|
type StoryPrivacySettings interface {
|
|
StoryPrivacySettingsType() string
|
|
}
|
|
|
|
// Represents a single rule for managing user privacy settings
|
|
type UserPrivacySettingRule interface {
|
|
UserPrivacySettingRuleType() string
|
|
}
|
|
|
|
// Describes available user privacy settings
|
|
type UserPrivacySetting interface {
|
|
UserPrivacySettingType() string
|
|
}
|
|
|
|
// Describes result of canSendMessageToUser
|
|
type CanSendMessageToUserResult interface {
|
|
CanSendMessageToUserResultType() string
|
|
}
|
|
|
|
// Represents the type of a session
|
|
type SessionType interface {
|
|
SessionTypeType() string
|
|
}
|
|
|
|
// Describes the reason why a chat is reported
|
|
type ReportReason interface {
|
|
ReportReasonType() string
|
|
}
|
|
|
|
// 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
|
|
type InternalLinkType interface {
|
|
InternalLinkTypeType() string
|
|
}
|
|
|
|
// Describes a type of a block list
|
|
type BlockList interface {
|
|
BlockListType() string
|
|
}
|
|
|
|
// 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 scope of autosave settings
|
|
type AutosaveSettingsScope interface {
|
|
AutosaveSettingsScopeType() 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
|
|
}
|
|
|
|
// Describes the way the text needs to be parsed for text entities
|
|
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
|
|
}
|
|
|
|
// Describes type of an object, for which statistics are provided
|
|
type ChatStatisticsObjectType interface {
|
|
ChatStatisticsObjectTypeType() string
|
|
}
|
|
|
|
// Contains a detailed statistics about a chat
|
|
type ChatStatistics interface {
|
|
ChatStatisticsType() string
|
|
}
|
|
|
|
// Represents a vector path command
|
|
type VectorPathCommand interface {
|
|
VectorPathCommandType() string
|
|
}
|
|
|
|
// Represents the scope to which bot commands are relevant
|
|
type BotCommandScope interface {
|
|
BotCommandScopeType() string
|
|
}
|
|
|
|
// 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; applications may not receive this type of code
|
|
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
|
|
}
|
|
|
|
// 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
|
|
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
|
|
}
|
|
|
|
// 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
|
|
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
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// An authentication code is delivered via Firebase Authentication to the official Android application
|
|
type AuthenticationCodeTypeFirebaseAndroid struct {
|
|
meta
|
|
// Nonce to pass to the SafetyNet Attestation API
|
|
Nonce []byte `json:"nonce"`
|
|
// Length of the code
|
|
Length int32 `json:"length"`
|
|
}
|
|
|
|
func (entity *AuthenticationCodeTypeFirebaseAndroid) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub AuthenticationCodeTypeFirebaseAndroid
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*AuthenticationCodeTypeFirebaseAndroid) GetClass() string {
|
|
return ClassAuthenticationCodeType
|
|
}
|
|
|
|
func (*AuthenticationCodeTypeFirebaseAndroid) GetType() string {
|
|
return TypeAuthenticationCodeTypeFirebaseAndroid
|
|
}
|
|
|
|
func (*AuthenticationCodeTypeFirebaseAndroid) AuthenticationCodeTypeType() string {
|
|
return TypeAuthenticationCodeTypeFirebaseAndroid
|
|
}
|
|
|
|
// An authentication code is delivered via Firebase Authentication to the official iOS application
|
|
type AuthenticationCodeTypeFirebaseIos struct {
|
|
meta
|
|
// Receipt of successful application token validation to compare with receipt from push notification
|
|
Receipt string `json:"receipt"`
|
|
// Time after the next authentication method is supposed to be used if verification push notification isn't received, in seconds
|
|
PushTimeout int32 `json:"push_timeout"`
|
|
// Length of the code
|
|
Length int32 `json:"length"`
|
|
}
|
|
|
|
func (entity *AuthenticationCodeTypeFirebaseIos) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub AuthenticationCodeTypeFirebaseIos
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*AuthenticationCodeTypeFirebaseIos) GetClass() string {
|
|
return ClassAuthenticationCodeType
|
|
}
|
|
|
|
func (*AuthenticationCodeTypeFirebaseIos) GetType() string {
|
|
return TypeAuthenticationCodeTypeFirebaseIos
|
|
}
|
|
|
|
func (*AuthenticationCodeTypeFirebaseIos) AuthenticationCodeTypeType() string {
|
|
return TypeAuthenticationCodeTypeFirebaseIos
|
|
}
|
|
|
|
// Information about the authentication code that was sent
|
|
type AuthenticationCodeInfo struct {
|
|
meta
|
|
// A phone number that is being authenticated
|
|
PhoneNumber string `json:"phone_number"`
|
|
// The way the code was sent to the user
|
|
Type AuthenticationCodeType `json:"type"`
|
|
// The way the next code will be sent to the user; may be null
|
|
NextType AuthenticationCodeType `json:"next_type"`
|
|
// Timeout before the code can be re-sent, in seconds
|
|
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
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// Email address can be reset after the given period. Call resetAuthenticationEmailAddress to reset it and allow the user to authorize with a code sent to the user's phone number
|
|
type EmailAddressResetStateAvailable struct {
|
|
meta
|
|
// Time required to wait before the email address can be reset; 0 if the user is subscribed to Telegram Premium
|
|
WaitPeriod int32 `json:"wait_period"`
|
|
}
|
|
|
|
func (entity *EmailAddressResetStateAvailable) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub EmailAddressResetStateAvailable
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*EmailAddressResetStateAvailable) GetClass() string {
|
|
return ClassEmailAddressResetState
|
|
}
|
|
|
|
func (*EmailAddressResetStateAvailable) GetType() string {
|
|
return TypeEmailAddressResetStateAvailable
|
|
}
|
|
|
|
func (*EmailAddressResetStateAvailable) EmailAddressResetStateType() string {
|
|
return TypeEmailAddressResetStateAvailable
|
|
}
|
|
|
|
// Email address reset has already been requested. Call resetAuthenticationEmailAddress to check whether immediate reset is possible
|
|
type EmailAddressResetStatePending struct {
|
|
meta
|
|
// Left time before the email address will be reset, in seconds. updateAuthorizationState is not sent when this field changes
|
|
ResetIn int32 `json:"reset_in"`
|
|
}
|
|
|
|
func (entity *EmailAddressResetStatePending) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub EmailAddressResetStatePending
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*EmailAddressResetStatePending) GetClass() string {
|
|
return ClassEmailAddressResetState
|
|
}
|
|
|
|
func (*EmailAddressResetStatePending) GetType() string {
|
|
return TypeEmailAddressResetStatePending
|
|
}
|
|
|
|
func (*EmailAddressResetStatePending) EmailAddressResetStateType() string {
|
|
return TypeEmailAddressResetStatePending
|
|
}
|
|
|
|
// 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"`
|
|
// 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. BlockQuote entities can't contain other BlockQuote 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
|
|
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"`
|
|
// The minimum age of a user to be able to accept the terms; 0 if age isn't restricted
|
|
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
|
|
}
|
|
|
|
// Initialization parameters are needed. Call setTdlibParameters to provide them
|
|
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
|
|
}
|
|
|
|
// 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 {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *AuthorizationStateWaitEmailAddress) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub AuthorizationStateWaitEmailAddress
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*AuthorizationStateWaitEmailAddress) GetClass() string {
|
|
return ClassAuthorizationState
|
|
}
|
|
|
|
func (*AuthorizationStateWaitEmailAddress) GetType() string {
|
|
return TypeAuthorizationStateWaitEmailAddress
|
|
}
|
|
|
|
func (*AuthorizationStateWaitEmailAddress) AuthorizationStateType() string {
|
|
return TypeAuthorizationStateWaitEmailAddress
|
|
}
|
|
|
|
// TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code
|
|
type AuthorizationStateWaitEmailCode struct {
|
|
meta
|
|
// 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"`
|
|
// Reset state of the email address; may be null if the email address can't be reset
|
|
EmailAddressResetState EmailAddressResetState `json:"email_address_reset_state"`
|
|
}
|
|
|
|
func (entity *AuthorizationStateWaitEmailCode) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub AuthorizationStateWaitEmailCode
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*AuthorizationStateWaitEmailCode) GetClass() string {
|
|
return ClassAuthorizationState
|
|
}
|
|
|
|
func (*AuthorizationStateWaitEmailCode) GetType() string {
|
|
return TypeAuthorizationStateWaitEmailCode
|
|
}
|
|
|
|
func (*AuthorizationStateWaitEmailCode) AuthorizationStateType() string {
|
|
return TypeAuthorizationStateWaitEmailCode
|
|
}
|
|
|
|
func (authorizationStateWaitEmailCode *AuthorizationStateWaitEmailCode) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
AllowAppleId bool `json:"allow_apple_id"`
|
|
AllowGoogleId bool `json:"allow_google_id"`
|
|
CodeInfo *EmailAddressAuthenticationCodeInfo `json:"code_info"`
|
|
EmailAddressResetState json.RawMessage `json:"email_address_reset_state"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
authorizationStateWaitEmailCode.AllowAppleId = tmp.AllowAppleId
|
|
authorizationStateWaitEmailCode.AllowGoogleId = tmp.AllowGoogleId
|
|
authorizationStateWaitEmailCode.CodeInfo = tmp.CodeInfo
|
|
|
|
fieldEmailAddressResetState, _ := UnmarshalEmailAddressResetState(tmp.EmailAddressResetState)
|
|
authorizationStateWaitEmailCode.EmailAddressResetState = fieldEmailAddressResetState
|
|
|
|
return nil
|
|
}
|
|
|
|
// TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code
|
|
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
|
|
}
|
|
|
|
// 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
|
|
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
|
|
}
|
|
|
|
// 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
|
|
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"`
|
|
// True, if some Telegram Passport elements were saved
|
|
HasPassportData bool `json:"has_passport_data"`
|
|
// 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
|
|
}
|
|
|
|
// The user has been successfully authorized. TDLib is now ready to answer general requests
|
|
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
|
|
}
|
|
|
|
// 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
|
|
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"`
|
|
// 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
|
|
PendingResetDate int32 `json:"pending_reset_date"`
|
|
}
|
|
|
|
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"`
|
|
// True, if it is possible to download or generate the file
|
|
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
|
|
DownloadOffset int64 `json:"download_offset"`
|
|
// 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
|
|
DownloadedPrefixSize int64 `json:"downloaded_prefix_size"`
|
|
// 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
|
|
DownloadedSize int64 `json:"downloaded_size"`
|
|
}
|
|
|
|
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
|
|
// 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 identifier 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
|
|
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"`
|
|
// Size of the remote available part of the file, in bytes; 0 if unknown
|
|
UploadedSize int64 `json:"uploaded_size"`
|
|
}
|
|
|
|
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"`
|
|
// File size, in bytes; 0 if unknown
|
|
Size int64 `json:"size"`
|
|
// Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress
|
|
ExpectedSize int64 `json:"expected_size"`
|
|
// 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 identifier
|
|
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 identifier. The remote identifier 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"`
|
|
// String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage
|
|
Conversion string `json:"conversion"`
|
|
// Expected size of the generated file, in bytes; 0 if unknown
|
|
ExpectedSize int64 `json:"expected_size"`
|
|
}
|
|
|
|
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"`
|
|
// Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes
|
|
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
|
|
}
|
|
|
|
// The thumbnail is in static GIF format. It will be used only for some bot inline query results
|
|
type ThumbnailFormatGif struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ThumbnailFormatGif) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ThumbnailFormatGif
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ThumbnailFormatGif) GetClass() string {
|
|
return ClassThumbnailFormat
|
|
}
|
|
|
|
func (*ThumbnailFormatGif) GetType() string {
|
|
return TypeThumbnailFormatGif
|
|
}
|
|
|
|
func (*ThumbnailFormatGif) ThumbnailFormatType() string {
|
|
return TypeThumbnailFormatGif
|
|
}
|
|
|
|
// The thumbnail is in MPEG4 format. It will be used only for some animations and videos
|
|
type ThumbnailFormatMpeg4 struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ThumbnailFormatMpeg4) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ThumbnailFormatMpeg4
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ThumbnailFormatMpeg4) GetClass() string {
|
|
return ClassThumbnailFormat
|
|
}
|
|
|
|
func (*ThumbnailFormatMpeg4) GetType() string {
|
|
return TypeThumbnailFormatMpeg4
|
|
}
|
|
|
|
func (*ThumbnailFormatMpeg4) ThumbnailFormatType() string {
|
|
return TypeThumbnailFormatMpeg4
|
|
}
|
|
|
|
// The thumbnail is in PNG format. It will be used only for background patterns
|
|
type ThumbnailFormatPng struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ThumbnailFormatPng) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ThumbnailFormatPng
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ThumbnailFormatPng) GetClass() string {
|
|
return ClassThumbnailFormat
|
|
}
|
|
|
|
func (*ThumbnailFormatPng) GetType() string {
|
|
return TypeThumbnailFormatPng
|
|
}
|
|
|
|
func (*ThumbnailFormatPng) ThumbnailFormatType() string {
|
|
return TypeThumbnailFormatPng
|
|
}
|
|
|
|
// The thumbnail is in TGS format. It will be used only for sticker sets
|
|
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
|
|
}
|
|
|
|
// The thumbnail is in WEBM format. It will be used only for sticker sets
|
|
type ThumbnailFormatWebm struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ThumbnailFormatWebm) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ThumbnailFormatWebm
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ThumbnailFormatWebm) GetClass() string {
|
|
return ClassThumbnailFormat
|
|
}
|
|
|
|
func (*ThumbnailFormatWebm) GetType() string {
|
|
return TypeThumbnailFormatWebm
|
|
}
|
|
|
|
func (*ThumbnailFormatWebm) ThumbnailFormatType() string {
|
|
return TypeThumbnailFormatWebm
|
|
}
|
|
|
|
// The thumbnail is in WEBP format. It will be used only for some stickers and sticker sets
|
|
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
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// The mask is placed relatively to the forehead
|
|
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
|
|
}
|
|
|
|
// The mask is placed relatively to the eyes
|
|
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
|
|
}
|
|
|
|
// The mask is placed relatively to the mouth
|
|
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
|
|
}
|
|
|
|
// The mask is placed relatively to the chin
|
|
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
|
|
}
|
|
|
|
// Position on a photo where a mask is placed
|
|
type MaskPosition struct {
|
|
meta
|
|
// Part of the face, relative to which the mask is placed
|
|
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
|
|
}
|
|
|
|
// The sticker is an image in WEBP format
|
|
type StickerFormatWebp struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *StickerFormatWebp) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub StickerFormatWebp
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*StickerFormatWebp) GetClass() string {
|
|
return ClassStickerFormat
|
|
}
|
|
|
|
func (*StickerFormatWebp) GetType() string {
|
|
return TypeStickerFormatWebp
|
|
}
|
|
|
|
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, white color on chat photos, 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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fieldCommands, _ := UnmarshalListOfVectorPathCommand(tmp.Commands)
|
|
closedVectorPath.Commands = fieldCommands
|
|
|
|
return nil
|
|
}
|
|
|
|
// Describes one answer option of a poll
|
|
type PollOption struct {
|
|
meta
|
|
// Option text; 1-100 characters
|
|
Text string `json:"text"`
|
|
// Number of voters for this option, available only for closed or voted polls
|
|
VoterCount int32 `json:"voter_count"`
|
|
// The percentage of votes for this option; 0-100
|
|
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"`
|
|
// 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
|
|
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"`
|
|
// 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
|
|
AlbumCoverThumbnail *Thumbnail `json:"album_cover_thumbnail"`
|
|
// 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"`
|
|
// 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
|
|
// Unique sticker identifier within the set; 0 if none
|
|
Id JsonInt64 `json:"id"`
|
|
// 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"`
|
|
// Sticker format
|
|
Format StickerFormat `json:"format"`
|
|
// Sticker's full type
|
|
FullType StickerFullType `json:"full_type"`
|
|
// 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"`
|
|
// 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
|
|
}
|
|
|
|
func (sticker *Sticker) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Id JsonInt64 `json:"id"`
|
|
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.Id = tmp.Id
|
|
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
|
|
}
|
|
|
|
// 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"`
|
|
// True, if the video is supposed to be streamed
|
|
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"`
|
|
// A waveform representation of the video note's audio in 5-bit format; may be empty if unknown
|
|
Waveform []byte `json:"waveform"`
|
|
// 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"`
|
|
// Result of speech recognition in the video note; may be null
|
|
SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"`
|
|
// 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
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// 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"`
|
|
// Result of speech recognition in the voice note; may be null
|
|
SpeechRecognitionResult SpeechRecognitionResult `json:"speech_recognition_result"`
|
|
// 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
|
|
}
|
|
|
|
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
|
|
type AnimatedEmoji struct {
|
|
meta
|
|
// Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, then it can have arbitrary format
|
|
Sticker *Sticker `json:"sticker"`
|
|
// 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"`
|
|
// Emoji modifier fitzpatrick type; 0-6; 0 if none
|
|
FitzpatrickType int32 `json:"fitzpatrick_type"`
|
|
// 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
|
|
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
|
|
}
|
|
|
|
// 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; 0 otherwise
|
|
UserId int64 `json:"user_id"`
|
|
}
|
|
|
|
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"`
|
|
// Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported
|
|
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. Use getInternalLink with internalLinkTypeGame to share the game
|
|
type Game struct {
|
|
meta
|
|
// Unique game identifier
|
|
Id JsonInt64 `json:"id"`
|
|
// 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 Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App
|
|
type WebApp struct {
|
|
meta
|
|
// Web App short name
|
|
ShortName string `json:"short_name"`
|
|
// Web App title
|
|
Title string `json:"title"`
|
|
// Web App description
|
|
Description string `json:"description"`
|
|
// Web App photo
|
|
Photo *Photo `json:"photo"`
|
|
// Web App animation; may be null
|
|
Animation *Animation `json:"animation"`
|
|
}
|
|
|
|
func (entity *WebApp) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub WebApp
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*WebApp) GetClass() string {
|
|
return ClassWebApp
|
|
}
|
|
|
|
func (*WebApp) GetType() string {
|
|
return TypeWebApp
|
|
}
|
|
|
|
// Describes a poll
|
|
type Poll struct {
|
|
meta
|
|
// Unique poll identifier
|
|
Id JsonInt64 `json:"id"`
|
|
// Poll question; 1-300 characters
|
|
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"`
|
|
// Identifiers of recent voters, if the poll is non-anonymous
|
|
RecentVoterIds []MessageSender `json:"recent_voter_ids"`
|
|
// 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"`
|
|
// Point in time (Unix timestamp) when the poll will automatically be closed
|
|
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"`
|
|
RecentVoterIds []json.RawMessage `json:"recent_voter_ids"`
|
|
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.IsAnonymous = tmp.IsAnonymous
|
|
poll.OpenPeriod = tmp.OpenPeriod
|
|
poll.CloseDate = tmp.CloseDate
|
|
poll.IsClosed = tmp.IsClosed
|
|
|
|
fieldRecentVoterIds, _ := UnmarshalListOfMessageSender(tmp.RecentVoterIds)
|
|
poll.RecentVoterIds = fieldRecentVoterIds
|
|
|
|
fieldType, _ := UnmarshalPollType(tmp.Type)
|
|
poll.Type = fieldType
|
|
|
|
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
|
|
Name string `json:"name"`
|
|
// Document with the background; may be null. Null only for filled and chat theme 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
|
|
}
|
|
|
|
// Describes a background set for a specific chat
|
|
type ChatBackground struct {
|
|
meta
|
|
// The background
|
|
Background *Background `json:"background"`
|
|
// Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background
|
|
DarkThemeDimming int32 `json:"dark_theme_dimming"`
|
|
}
|
|
|
|
func (entity *ChatBackground) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatBackground
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatBackground) GetClass() string {
|
|
return ClassChatBackground
|
|
}
|
|
|
|
func (*ChatBackground) GetType() string {
|
|
return TypeChatBackground
|
|
}
|
|
|
|
// 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"`
|
|
// User profile photo minithumbnail; may be null
|
|
Minithumbnail *Minithumbnail `json:"minithumbnail"`
|
|
// True, if the photo has animated variant
|
|
HasAnimation bool `json:"has_animation"`
|
|
// True, if the photo is visible only for the current user
|
|
IsPersonal bool `json:"is_personal"`
|
|
}
|
|
|
|
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"`
|
|
// Chat photo minithumbnail; may be null
|
|
Minithumbnail *Minithumbnail `json:"minithumbnail"`
|
|
// True, if the photo has animated variant
|
|
HasAnimation bool `json:"has_animation"`
|
|
// True, if the photo is visible only for the current user
|
|
IsPersonal bool `json:"is_personal"`
|
|
}
|
|
|
|
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 is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription
|
|
CanBeEdited bool `json:"can_be_edited"`
|
|
// 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"`
|
|
// True, if the location of the user is expected to be sent with every inline query to this bot
|
|
NeedLocation bool `json:"need_location"`
|
|
// True, if the bot supports connection to Telegram Business accounts
|
|
CanConnectToBusiness bool `json:"can_connect_to_business"`
|
|
// True, if the bot can be added to attachment or side menu
|
|
CanBeAddedToAttachmentMenu bool `json:"can_be_added_to_attachment_menu"`
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// Contains a list of bot commands
|
|
type BotCommands struct {
|
|
meta
|
|
// Bot's user identifier
|
|
BotUserId int64 `json:"bot_user_id"`
|
|
// List of bot commands
|
|
Commands []*BotCommand `json:"commands"`
|
|
}
|
|
|
|
func (entity *BotCommands) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BotCommands
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BotCommands) GetClass() string {
|
|
return ClassBotCommands
|
|
}
|
|
|
|
func (*BotCommands) GetType() string {
|
|
return TypeBotCommands
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// Represents a birthdate of a user
|
|
type Birthdate struct {
|
|
meta
|
|
// Day of the month; 1-31
|
|
Day int32 `json:"day"`
|
|
// Month of the year; 1-12
|
|
Month int32 `json:"month"`
|
|
// Birth year; 0 if unknown
|
|
Year int32 `json:"year"`
|
|
}
|
|
|
|
func (entity *Birthdate) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub Birthdate
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*Birthdate) GetClass() string {
|
|
return ClassBirthdate
|
|
}
|
|
|
|
func (*Birthdate) GetType() string {
|
|
return TypeBirthdate
|
|
}
|
|
|
|
// Describes a user that had or will have a birthday soon
|
|
type CloseBirthdayUser struct {
|
|
meta
|
|
// User identifier
|
|
UserId int64 `json:"user_id"`
|
|
// Birthdate of the user
|
|
Birthdate *Birthdate `json:"birthdate"`
|
|
}
|
|
|
|
func (entity *CloseBirthdayUser) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub CloseBirthdayUser
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*CloseBirthdayUser) GetClass() string {
|
|
return ClassCloseBirthdayUser
|
|
}
|
|
|
|
func (*CloseBirthdayUser) GetType() string {
|
|
return TypeCloseBirthdayUser
|
|
}
|
|
|
|
// Send away messages always
|
|
type BusinessAwayMessageScheduleAlways struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *BusinessAwayMessageScheduleAlways) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessAwayMessageScheduleAlways
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessAwayMessageScheduleAlways) GetClass() string {
|
|
return ClassBusinessAwayMessageSchedule
|
|
}
|
|
|
|
func (*BusinessAwayMessageScheduleAlways) GetType() string {
|
|
return TypeBusinessAwayMessageScheduleAlways
|
|
}
|
|
|
|
func (*BusinessAwayMessageScheduleAlways) BusinessAwayMessageScheduleType() string {
|
|
return TypeBusinessAwayMessageScheduleAlways
|
|
}
|
|
|
|
// Send away messages outside of the business opening hours
|
|
type BusinessAwayMessageScheduleOutsideOfOpeningHours struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *BusinessAwayMessageScheduleOutsideOfOpeningHours) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessAwayMessageScheduleOutsideOfOpeningHours
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessAwayMessageScheduleOutsideOfOpeningHours) GetClass() string {
|
|
return ClassBusinessAwayMessageSchedule
|
|
}
|
|
|
|
func (*BusinessAwayMessageScheduleOutsideOfOpeningHours) GetType() string {
|
|
return TypeBusinessAwayMessageScheduleOutsideOfOpeningHours
|
|
}
|
|
|
|
func (*BusinessAwayMessageScheduleOutsideOfOpeningHours) BusinessAwayMessageScheduleType() string {
|
|
return TypeBusinessAwayMessageScheduleOutsideOfOpeningHours
|
|
}
|
|
|
|
// Send away messages only in the specified time span
|
|
type BusinessAwayMessageScheduleCustom struct {
|
|
meta
|
|
// Point in time (Unix timestamp) when the away messages will start to be sent
|
|
StartDate int32 `json:"start_date"`
|
|
// Point in time (Unix timestamp) when the away messages will stop to be sent
|
|
EndDate int32 `json:"end_date"`
|
|
}
|
|
|
|
func (entity *BusinessAwayMessageScheduleCustom) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessAwayMessageScheduleCustom
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessAwayMessageScheduleCustom) GetClass() string {
|
|
return ClassBusinessAwayMessageSchedule
|
|
}
|
|
|
|
func (*BusinessAwayMessageScheduleCustom) GetType() string {
|
|
return TypeBusinessAwayMessageScheduleCustom
|
|
}
|
|
|
|
func (*BusinessAwayMessageScheduleCustom) BusinessAwayMessageScheduleType() string {
|
|
return TypeBusinessAwayMessageScheduleCustom
|
|
}
|
|
|
|
// Represents a location of a business
|
|
type BusinessLocation struct {
|
|
meta
|
|
// The location; may be null if not specified
|
|
Location *Location `json:"location"`
|
|
// Location address; 1-96 characters
|
|
Address string `json:"address"`
|
|
}
|
|
|
|
func (entity *BusinessLocation) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessLocation
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessLocation) GetClass() string {
|
|
return ClassBusinessLocation
|
|
}
|
|
|
|
func (*BusinessLocation) GetType() string {
|
|
return TypeBusinessLocation
|
|
}
|
|
|
|
// Describes private chats chosen for automatic interaction with a business
|
|
type BusinessRecipients struct {
|
|
meta
|
|
// Identifiers of selected private chats
|
|
ChatIds []int64 `json:"chat_ids"`
|
|
// Identifiers of private chats that are always excluded; for businessConnectedBot only
|
|
ExcludedChatIds []int64 `json:"excluded_chat_ids"`
|
|
// True, if all existing private chats are selected
|
|
SelectExistingChats bool `json:"select_existing_chats"`
|
|
// True, if all new private chats are selected
|
|
SelectNewChats bool `json:"select_new_chats"`
|
|
// True, if all private chats with contacts are selected
|
|
SelectContacts bool `json:"select_contacts"`
|
|
// True, if all private chats with non-contacts are selected
|
|
SelectNonContacts bool `json:"select_non_contacts"`
|
|
// If true, then all private chats except the selected are chosen. Otherwise, only the selected chats are chosen
|
|
ExcludeSelected bool `json:"exclude_selected"`
|
|
}
|
|
|
|
func (entity *BusinessRecipients) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessRecipients
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessRecipients) GetClass() string {
|
|
return ClassBusinessRecipients
|
|
}
|
|
|
|
func (*BusinessRecipients) GetType() string {
|
|
return TypeBusinessRecipients
|
|
}
|
|
|
|
// Describes settings for messages that are automatically sent by a Telegram Business account when it is away
|
|
type BusinessAwayMessageSettings struct {
|
|
meta
|
|
// Unique quick reply shortcut identifier for the away messages
|
|
ShortcutId int32 `json:"shortcut_id"`
|
|
// Chosen recipients of the away messages
|
|
Recipients *BusinessRecipients `json:"recipients"`
|
|
// Settings used to check whether the current user is away
|
|
Schedule BusinessAwayMessageSchedule `json:"schedule"`
|
|
// True, if the messages must not be sent if the account was online in the last 10 minutes
|
|
OfflineOnly bool `json:"offline_only"`
|
|
}
|
|
|
|
func (entity *BusinessAwayMessageSettings) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessAwayMessageSettings
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessAwayMessageSettings) GetClass() string {
|
|
return ClassBusinessAwayMessageSettings
|
|
}
|
|
|
|
func (*BusinessAwayMessageSettings) GetType() string {
|
|
return TypeBusinessAwayMessageSettings
|
|
}
|
|
|
|
func (businessAwayMessageSettings *BusinessAwayMessageSettings) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
ShortcutId int32 `json:"shortcut_id"`
|
|
Recipients *BusinessRecipients `json:"recipients"`
|
|
Schedule json.RawMessage `json:"schedule"`
|
|
OfflineOnly bool `json:"offline_only"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
businessAwayMessageSettings.ShortcutId = tmp.ShortcutId
|
|
businessAwayMessageSettings.Recipients = tmp.Recipients
|
|
businessAwayMessageSettings.OfflineOnly = tmp.OfflineOnly
|
|
|
|
fieldSchedule, _ := UnmarshalBusinessAwayMessageSchedule(tmp.Schedule)
|
|
businessAwayMessageSettings.Schedule = fieldSchedule
|
|
|
|
return nil
|
|
}
|
|
|
|
// Describes settings for greeting messages that are automatically sent by a Telegram Business account as response to incoming messages in an inactive private chat
|
|
type BusinessGreetingMessageSettings struct {
|
|
meta
|
|
// Unique quick reply shortcut identifier for the greeting messages
|
|
ShortcutId int32 `json:"shortcut_id"`
|
|
// Chosen recipients of the greeting messages
|
|
Recipients *BusinessRecipients `json:"recipients"`
|
|
// The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28
|
|
InactivityDays int32 `json:"inactivity_days"`
|
|
}
|
|
|
|
func (entity *BusinessGreetingMessageSettings) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessGreetingMessageSettings
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessGreetingMessageSettings) GetClass() string {
|
|
return ClassBusinessGreetingMessageSettings
|
|
}
|
|
|
|
func (*BusinessGreetingMessageSettings) GetType() string {
|
|
return TypeBusinessGreetingMessageSettings
|
|
}
|
|
|
|
// Describes a bot connected to a business account
|
|
type BusinessConnectedBot struct {
|
|
meta
|
|
// User identifier of the bot
|
|
BotUserId int64 `json:"bot_user_id"`
|
|
// Private chats that will be accessible to the bot
|
|
Recipients *BusinessRecipients `json:"recipients"`
|
|
// True, if the bot can send messages to the private chats; false otherwise
|
|
CanReply bool `json:"can_reply"`
|
|
}
|
|
|
|
func (entity *BusinessConnectedBot) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessConnectedBot
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessConnectedBot) GetClass() string {
|
|
return ClassBusinessConnectedBot
|
|
}
|
|
|
|
func (*BusinessConnectedBot) GetType() string {
|
|
return TypeBusinessConnectedBot
|
|
}
|
|
|
|
// Describes settings for a business account intro
|
|
type BusinessIntro struct {
|
|
meta
|
|
// Title text of the intro
|
|
Title string `json:"title"`
|
|
// Message text of the intro
|
|
Message string `json:"message"`
|
|
// Greeting sticker of the intro; may be null if none
|
|
Sticker *Sticker `json:"sticker"`
|
|
}
|
|
|
|
func (entity *BusinessIntro) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessIntro
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessIntro) GetClass() string {
|
|
return ClassBusinessIntro
|
|
}
|
|
|
|
func (*BusinessIntro) GetType() string {
|
|
return TypeBusinessIntro
|
|
}
|
|
|
|
// Describes settings for a business account intro to set
|
|
type InputBusinessIntro struct {
|
|
meta
|
|
// Title text of the intro; 0-getOption("business_intro_title_length_max") characters
|
|
Title string `json:"title"`
|
|
// Message text of the intro; 0-getOption("business_intro_message_length_max") characters
|
|
Message string `json:"message"`
|
|
// Greeting sticker of the intro; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji
|
|
Sticker InputFile `json:"sticker"`
|
|
}
|
|
|
|
func (entity *InputBusinessIntro) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputBusinessIntro
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputBusinessIntro) GetClass() string {
|
|
return ClassInputBusinessIntro
|
|
}
|
|
|
|
func (*InputBusinessIntro) GetType() string {
|
|
return TypeInputBusinessIntro
|
|
}
|
|
|
|
func (inputBusinessIntro *InputBusinessIntro) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Title string `json:"title"`
|
|
Message string `json:"message"`
|
|
Sticker json.RawMessage `json:"sticker"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
inputBusinessIntro.Title = tmp.Title
|
|
inputBusinessIntro.Message = tmp.Message
|
|
|
|
fieldSticker, _ := UnmarshalInputFile(tmp.Sticker)
|
|
inputBusinessIntro.Sticker = fieldSticker
|
|
|
|
return nil
|
|
}
|
|
|
|
// Describes an interval of time when the business is open
|
|
type BusinessOpeningHoursInterval struct {
|
|
meta
|
|
// The first minute of the interval since start of the week; 0-7*24*60
|
|
StartMinute int32 `json:"start_minute"`
|
|
// The first minute after the end of the interval since start of the week; 1-8*24*60
|
|
EndMinute int32 `json:"end_minute"`
|
|
}
|
|
|
|
func (entity *BusinessOpeningHoursInterval) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessOpeningHoursInterval
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessOpeningHoursInterval) GetClass() string {
|
|
return ClassBusinessOpeningHoursInterval
|
|
}
|
|
|
|
func (*BusinessOpeningHoursInterval) GetType() string {
|
|
return TypeBusinessOpeningHoursInterval
|
|
}
|
|
|
|
// Describes opening hours of a business
|
|
type BusinessOpeningHours struct {
|
|
meta
|
|
// Unique time zone identifier
|
|
TimeZoneId string `json:"time_zone_id"`
|
|
// Intervals of the time when the business is open
|
|
OpeningHours []*BusinessOpeningHoursInterval `json:"opening_hours"`
|
|
}
|
|
|
|
func (entity *BusinessOpeningHours) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessOpeningHours
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessOpeningHours) GetClass() string {
|
|
return ClassBusinessOpeningHours
|
|
}
|
|
|
|
func (*BusinessOpeningHours) GetType() string {
|
|
return TypeBusinessOpeningHours
|
|
}
|
|
|
|
// Contains information about a Telegram Business account
|
|
type BusinessInfo struct {
|
|
meta
|
|
// Location of the business; may be null if none
|
|
Location *BusinessLocation `json:"location"`
|
|
// Opening hours of the business; may be null if none. The hours are guaranteed to be valid and has already been split by week days
|
|
OpeningHours *BusinessOpeningHours `json:"opening_hours"`
|
|
// The greeting message; may be null if none or the Business account is not of the current user
|
|
GreetingMessageSettings *BusinessGreetingMessageSettings `json:"greeting_message_settings"`
|
|
// The away message; may be null if none or the Business account is not of the current user
|
|
AwayMessageSettings *BusinessAwayMessageSettings `json:"away_message_settings"`
|
|
// Information about intro of the business; may be null if none
|
|
Intro *BusinessIntro `json:"intro"`
|
|
}
|
|
|
|
func (entity *BusinessInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessInfo) GetClass() string {
|
|
return ClassBusinessInfo
|
|
}
|
|
|
|
func (*BusinessInfo) GetType() string {
|
|
return TypeBusinessInfo
|
|
}
|
|
|
|
// Information about the sticker, which was used to create the chat photo
|
|
type ChatPhotoStickerTypeRegularOrMask struct {
|
|
meta
|
|
// Sticker set identifier
|
|
StickerSetId JsonInt64 `json:"sticker_set_id"`
|
|
// Identifier of the sticker in the set
|
|
StickerId JsonInt64 `json:"sticker_id"`
|
|
}
|
|
|
|
func (entity *ChatPhotoStickerTypeRegularOrMask) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatPhotoStickerTypeRegularOrMask
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatPhotoStickerTypeRegularOrMask) GetClass() string {
|
|
return ClassChatPhotoStickerType
|
|
}
|
|
|
|
func (*ChatPhotoStickerTypeRegularOrMask) GetType() string {
|
|
return TypeChatPhotoStickerTypeRegularOrMask
|
|
}
|
|
|
|
func (*ChatPhotoStickerTypeRegularOrMask) ChatPhotoStickerTypeType() string {
|
|
return TypeChatPhotoStickerTypeRegularOrMask
|
|
}
|
|
|
|
// Information about the custom emoji, which was used to create the chat photo
|
|
type ChatPhotoStickerTypeCustomEmoji struct {
|
|
meta
|
|
// Identifier of the custom emoji
|
|
CustomEmojiId JsonInt64 `json:"custom_emoji_id"`
|
|
}
|
|
|
|
func (entity *ChatPhotoStickerTypeCustomEmoji) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatPhotoStickerTypeCustomEmoji
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatPhotoStickerTypeCustomEmoji) GetClass() string {
|
|
return ClassChatPhotoStickerType
|
|
}
|
|
|
|
func (*ChatPhotoStickerTypeCustomEmoji) GetType() string {
|
|
return TypeChatPhotoStickerTypeCustomEmoji
|
|
}
|
|
|
|
func (*ChatPhotoStickerTypeCustomEmoji) ChatPhotoStickerTypeType() string {
|
|
return TypeChatPhotoStickerTypeCustomEmoji
|
|
}
|
|
|
|
// Information about the sticker, which was used to create the chat photo. The sticker is shown at the center of the photo and occupies at most 67% of it
|
|
type ChatPhotoSticker struct {
|
|
meta
|
|
// Type of the sticker
|
|
Type ChatPhotoStickerType `json:"type"`
|
|
// The fill to be used as background for the sticker; rotation angle in backgroundFillGradient isn't supported
|
|
BackgroundFill BackgroundFill `json:"background_fill"`
|
|
}
|
|
|
|
func (entity *ChatPhotoSticker) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatPhotoSticker
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatPhotoSticker) GetClass() string {
|
|
return ClassChatPhotoSticker
|
|
}
|
|
|
|
func (*ChatPhotoSticker) GetType() string {
|
|
return TypeChatPhotoSticker
|
|
}
|
|
|
|
func (chatPhotoSticker *ChatPhotoSticker) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Type json.RawMessage `json:"type"`
|
|
BackgroundFill json.RawMessage `json:"background_fill"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fieldType, _ := UnmarshalChatPhotoStickerType(tmp.Type)
|
|
chatPhotoSticker.Type = fieldType
|
|
|
|
fieldBackgroundFill, _ := UnmarshalBackgroundFill(tmp.BackgroundFill)
|
|
chatPhotoSticker.BackgroundFill = fieldBackgroundFill
|
|
|
|
return nil
|
|
}
|
|
|
|
// 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"`
|
|
// A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null
|
|
Animation *AnimatedChatPhoto `json:"animation"`
|
|
// 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"`
|
|
// Sticker-based version of the chat photo; may be null
|
|
Sticker *ChatPhotoSticker `json:"sticker"`
|
|
}
|
|
|
|
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
|
|
// Identifier of the current user's profile photo to reuse
|
|
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 1280 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
|
|
}
|
|
|
|
// A sticker on a custom background
|
|
type InputChatPhotoSticker struct {
|
|
meta
|
|
// Information about the sticker
|
|
Sticker *ChatPhotoSticker `json:"sticker"`
|
|
}
|
|
|
|
func (entity *InputChatPhotoSticker) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputChatPhotoSticker
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputChatPhotoSticker) GetClass() string {
|
|
return ClassInputChatPhoto
|
|
}
|
|
|
|
func (*InputChatPhotoSticker) GetType() string {
|
|
return TypeInputChatPhotoSticker
|
|
}
|
|
|
|
func (*InputChatPhotoSticker) InputChatPhotoType() string {
|
|
return TypeInputChatPhotoSticker
|
|
}
|
|
|
|
// Describes actions that a user is allowed to take in a chat
|
|
type ChatPermissions struct {
|
|
meta
|
|
// True, if the user can send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues
|
|
CanSendBasicMessages bool `json:"can_send_basic_messages"`
|
|
// True, if the user can send music files
|
|
CanSendAudios bool `json:"can_send_audios"`
|
|
// True, if the user can send documents
|
|
CanSendDocuments bool `json:"can_send_documents"`
|
|
// True, if the user can send photos
|
|
CanSendPhotos bool `json:"can_send_photos"`
|
|
// True, if the user can send videos
|
|
CanSendVideos bool `json:"can_send_videos"`
|
|
// True, if the user can send video notes
|
|
CanSendVideoNotes bool `json:"can_send_video_notes"`
|
|
// True, if the user can send voice notes
|
|
CanSendVoiceNotes bool `json:"can_send_voice_notes"`
|
|
// True, if the user can send polls
|
|
CanSendPolls bool `json:"can_send_polls"`
|
|
// True, if the user can send animations, games, stickers, and dice and use inline bots
|
|
CanSendOtherMessages bool `json:"can_send_other_messages"`
|
|
// True, if the user may add a web page preview to their messages
|
|
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 create topics
|
|
CanCreateTopics bool `json:"can_create_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 access the chat event log, get boost list, see hidden supergroup and channel members, report supergroup spam messages 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 or view channel statistics; 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 or view supergroup statistics; 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 create, rename, close, reopen, hide, and unhide forum 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 can create new chat stories, or edit and delete posted stories; applicable to supergroups and channels only
|
|
CanPostStories bool `json:"can_post_stories"`
|
|
// True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to supergroups and channels only
|
|
CanEditStories bool `json:"can_edit_stories"`
|
|
// True, if the administrator can delete stories posted by other users; applicable to supergroups and channels only
|
|
CanDeleteStories bool `json:"can_delete_stories"`
|
|
// 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 months 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 an option for buying or upgrading Telegram Premium for self
|
|
type PremiumStatePaymentOption struct {
|
|
meta
|
|
// Information about the payment option
|
|
PaymentOption *PremiumPaymentOption `json:"payment_option"`
|
|
// True, if this is the currently used Telegram Premium subscription option
|
|
IsCurrent bool `json:"is_current"`
|
|
// True, if the payment option can be used to upgrade the existing Telegram Premium subscription
|
|
IsUpgrade bool `json:"is_upgrade"`
|
|
// Identifier of the last in-store transaction for the currently used option
|
|
LastTransactionId string `json:"last_transaction_id"`
|
|
}
|
|
|
|
func (entity *PremiumStatePaymentOption) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumStatePaymentOption
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumStatePaymentOption) GetClass() string {
|
|
return ClassPremiumStatePaymentOption
|
|
}
|
|
|
|
func (*PremiumStatePaymentOption) GetType() string {
|
|
return TypePremiumStatePaymentOption
|
|
}
|
|
|
|
// Describes an option for creating Telegram Premium gift codes
|
|
type PremiumGiftCodePaymentOption struct {
|
|
meta
|
|
// ISO 4217 currency code for Telegram Premium gift code payment
|
|
Currency string `json:"currency"`
|
|
// The amount to pay, in the smallest units of the currency
|
|
Amount int64 `json:"amount"`
|
|
// Number of users which will be able to activate the gift codes
|
|
UserCount int32 `json:"user_count"`
|
|
// Number of months the Telegram Premium subscription will be active
|
|
MonthCount int32 `json:"month_count"`
|
|
// Identifier of the store product associated with the option; may be empty if none
|
|
StoreProductId string `json:"store_product_id"`
|
|
// Number of times the store product must be paid
|
|
StoreProductQuantity int32 `json:"store_product_quantity"`
|
|
}
|
|
|
|
func (entity *PremiumGiftCodePaymentOption) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumGiftCodePaymentOption
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumGiftCodePaymentOption) GetClass() string {
|
|
return ClassPremiumGiftCodePaymentOption
|
|
}
|
|
|
|
func (*PremiumGiftCodePaymentOption) GetType() string {
|
|
return TypePremiumGiftCodePaymentOption
|
|
}
|
|
|
|
// Contains a list of options for creating Telegram Premium gift codes
|
|
type PremiumGiftCodePaymentOptions struct {
|
|
meta
|
|
// The list of options
|
|
Options []*PremiumGiftCodePaymentOption `json:"options"`
|
|
}
|
|
|
|
func (entity *PremiumGiftCodePaymentOptions) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumGiftCodePaymentOptions
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumGiftCodePaymentOptions) GetClass() string {
|
|
return ClassPremiumGiftCodePaymentOptions
|
|
}
|
|
|
|
func (*PremiumGiftCodePaymentOptions) GetType() string {
|
|
return TypePremiumGiftCodePaymentOptions
|
|
}
|
|
|
|
// Contains information about a Telegram Premium gift code
|
|
type PremiumGiftCodeInfo struct {
|
|
meta
|
|
// Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used
|
|
CreatorId MessageSender `json:"creator_id"`
|
|
// Point in time (Unix timestamp) when the code was created
|
|
CreationDate int32 `json:"creation_date"`
|
|
// True, if the gift code was created for a giveaway
|
|
IsFromGiveaway bool `json:"is_from_giveaway"`
|
|
// Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message
|
|
GiveawayMessageId int64 `json:"giveaway_message_id"`
|
|
// Number of months the Telegram Premium subscription will be active after code activation
|
|
MonthCount int32 `json:"month_count"`
|
|
// Identifier of a user for which the code was created; 0 if none
|
|
UserId int64 `json:"user_id"`
|
|
// Point in time (Unix timestamp) when the code was activated; 0 if none
|
|
UseDate int32 `json:"use_date"`
|
|
}
|
|
|
|
func (entity *PremiumGiftCodeInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumGiftCodeInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumGiftCodeInfo) GetClass() string {
|
|
return ClassPremiumGiftCodeInfo
|
|
}
|
|
|
|
func (*PremiumGiftCodeInfo) GetType() string {
|
|
return TypePremiumGiftCodeInfo
|
|
}
|
|
|
|
func (premiumGiftCodeInfo *PremiumGiftCodeInfo) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
CreatorId json.RawMessage `json:"creator_id"`
|
|
CreationDate int32 `json:"creation_date"`
|
|
IsFromGiveaway bool `json:"is_from_giveaway"`
|
|
GiveawayMessageId int64 `json:"giveaway_message_id"`
|
|
MonthCount int32 `json:"month_count"`
|
|
UserId int64 `json:"user_id"`
|
|
UseDate int32 `json:"use_date"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
premiumGiftCodeInfo.CreationDate = tmp.CreationDate
|
|
premiumGiftCodeInfo.IsFromGiveaway = tmp.IsFromGiveaway
|
|
premiumGiftCodeInfo.GiveawayMessageId = tmp.GiveawayMessageId
|
|
premiumGiftCodeInfo.MonthCount = tmp.MonthCount
|
|
premiumGiftCodeInfo.UserId = tmp.UserId
|
|
premiumGiftCodeInfo.UseDate = tmp.UseDate
|
|
|
|
fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId)
|
|
premiumGiftCodeInfo.CreatorId = fieldCreatorId
|
|
|
|
return nil
|
|
}
|
|
|
|
// The user is eligible for the giveaway
|
|
type PremiumGiveawayParticipantStatusEligible struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PremiumGiveawayParticipantStatusEligible) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumGiveawayParticipantStatusEligible
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusEligible) GetClass() string {
|
|
return ClassPremiumGiveawayParticipantStatus
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusEligible) GetType() string {
|
|
return TypePremiumGiveawayParticipantStatusEligible
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusEligible) PremiumGiveawayParticipantStatusType() string {
|
|
return TypePremiumGiveawayParticipantStatusEligible
|
|
}
|
|
|
|
// The user participates in the giveaway
|
|
type PremiumGiveawayParticipantStatusParticipating struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PremiumGiveawayParticipantStatusParticipating) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumGiveawayParticipantStatusParticipating
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusParticipating) GetClass() string {
|
|
return ClassPremiumGiveawayParticipantStatus
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusParticipating) GetType() string {
|
|
return TypePremiumGiveawayParticipantStatusParticipating
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusParticipating) PremiumGiveawayParticipantStatusType() string {
|
|
return TypePremiumGiveawayParticipantStatusParticipating
|
|
}
|
|
|
|
// The user can't participate in the giveaway, because they have already been member of the chat
|
|
type PremiumGiveawayParticipantStatusAlreadyWasMember struct {
|
|
meta
|
|
// Point in time (Unix timestamp) when the user joined the chat
|
|
JoinedChatDate int32 `json:"joined_chat_date"`
|
|
}
|
|
|
|
func (entity *PremiumGiveawayParticipantStatusAlreadyWasMember) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumGiveawayParticipantStatusAlreadyWasMember
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusAlreadyWasMember) GetClass() string {
|
|
return ClassPremiumGiveawayParticipantStatus
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusAlreadyWasMember) GetType() string {
|
|
return TypePremiumGiveawayParticipantStatusAlreadyWasMember
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusAlreadyWasMember) PremiumGiveawayParticipantStatusType() string {
|
|
return TypePremiumGiveawayParticipantStatusAlreadyWasMember
|
|
}
|
|
|
|
// The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway
|
|
type PremiumGiveawayParticipantStatusAdministrator struct {
|
|
meta
|
|
// Identifier of the chat administered by the user
|
|
ChatId int64 `json:"chat_id"`
|
|
}
|
|
|
|
func (entity *PremiumGiveawayParticipantStatusAdministrator) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumGiveawayParticipantStatusAdministrator
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusAdministrator) GetClass() string {
|
|
return ClassPremiumGiveawayParticipantStatus
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusAdministrator) GetType() string {
|
|
return TypePremiumGiveawayParticipantStatusAdministrator
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusAdministrator) PremiumGiveawayParticipantStatusType() string {
|
|
return TypePremiumGiveawayParticipantStatusAdministrator
|
|
}
|
|
|
|
// The user can't participate in the giveaway, because they phone number is from a disallowed country
|
|
type PremiumGiveawayParticipantStatusDisallowedCountry struct {
|
|
meta
|
|
// A two-letter ISO 3166-1 alpha-2 country code of the user's country
|
|
UserCountryCode string `json:"user_country_code"`
|
|
}
|
|
|
|
func (entity *PremiumGiveawayParticipantStatusDisallowedCountry) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumGiveawayParticipantStatusDisallowedCountry
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusDisallowedCountry) GetClass() string {
|
|
return ClassPremiumGiveawayParticipantStatus
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusDisallowedCountry) GetType() string {
|
|
return TypePremiumGiveawayParticipantStatusDisallowedCountry
|
|
}
|
|
|
|
func (*PremiumGiveawayParticipantStatusDisallowedCountry) PremiumGiveawayParticipantStatusType() string {
|
|
return TypePremiumGiveawayParticipantStatusDisallowedCountry
|
|
}
|
|
|
|
// Describes an ongoing giveaway
|
|
type PremiumGiveawayInfoOngoing struct {
|
|
meta
|
|
// Point in time (Unix timestamp) when the giveaway was created
|
|
CreationDate int32 `json:"creation_date"`
|
|
// Status of the current user in the giveaway
|
|
Status PremiumGiveawayParticipantStatus `json:"status"`
|
|
// True, if the giveaway has ended and results are being prepared
|
|
IsEnded bool `json:"is_ended"`
|
|
}
|
|
|
|
func (entity *PremiumGiveawayInfoOngoing) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumGiveawayInfoOngoing
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumGiveawayInfoOngoing) GetClass() string {
|
|
return ClassPremiumGiveawayInfo
|
|
}
|
|
|
|
func (*PremiumGiveawayInfoOngoing) GetType() string {
|
|
return TypePremiumGiveawayInfoOngoing
|
|
}
|
|
|
|
func (*PremiumGiveawayInfoOngoing) PremiumGiveawayInfoType() string {
|
|
return TypePremiumGiveawayInfoOngoing
|
|
}
|
|
|
|
func (premiumGiveawayInfoOngoing *PremiumGiveawayInfoOngoing) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
CreationDate int32 `json:"creation_date"`
|
|
Status json.RawMessage `json:"status"`
|
|
IsEnded bool `json:"is_ended"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
premiumGiveawayInfoOngoing.CreationDate = tmp.CreationDate
|
|
premiumGiveawayInfoOngoing.IsEnded = tmp.IsEnded
|
|
|
|
fieldStatus, _ := UnmarshalPremiumGiveawayParticipantStatus(tmp.Status)
|
|
premiumGiveawayInfoOngoing.Status = fieldStatus
|
|
|
|
return nil
|
|
}
|
|
|
|
// Describes a completed giveaway
|
|
type PremiumGiveawayInfoCompleted struct {
|
|
meta
|
|
// Point in time (Unix timestamp) when the giveaway was created
|
|
CreationDate int32 `json:"creation_date"`
|
|
// Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway
|
|
ActualWinnersSelectionDate int32 `json:"actual_winners_selection_date"`
|
|
// True, if the giveaway was canceled and was fully refunded
|
|
WasRefunded bool `json:"was_refunded"`
|
|
// Number of winners in the giveaway
|
|
WinnerCount int32 `json:"winner_count"`
|
|
// Number of winners, which activated their gift codes
|
|
ActivationCount int32 `json:"activation_count"`
|
|
// Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway
|
|
GiftCode string `json:"gift_code"`
|
|
}
|
|
|
|
func (entity *PremiumGiveawayInfoCompleted) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumGiveawayInfoCompleted
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumGiveawayInfoCompleted) GetClass() string {
|
|
return ClassPremiumGiveawayInfo
|
|
}
|
|
|
|
func (*PremiumGiveawayInfoCompleted) GetType() string {
|
|
return TypePremiumGiveawayInfoCompleted
|
|
}
|
|
|
|
func (*PremiumGiveawayInfoCompleted) PremiumGiveawayInfoType() string {
|
|
return TypePremiumGiveawayInfoCompleted
|
|
}
|
|
|
|
// Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews
|
|
type AccentColor struct {
|
|
meta
|
|
// Accent color identifier
|
|
Id int32 `json:"id"`
|
|
// Identifier of a built-in color to use in places, where only one color is needed; 0-6
|
|
BuiltInAccentColorId int32 `json:"built_in_accent_color_id"`
|
|
// The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes
|
|
LightThemeColors []int32 `json:"light_theme_colors"`
|
|
// The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes
|
|
DarkThemeColors []int32 `json:"dark_theme_colors"`
|
|
// The minimum chat boost level required to use the color in a channel chat
|
|
MinChannelChatBoostLevel int32 `json:"min_channel_chat_boost_level"`
|
|
}
|
|
|
|
func (entity *AccentColor) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub AccentColor
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*AccentColor) GetClass() string {
|
|
return ClassAccentColor
|
|
}
|
|
|
|
func (*AccentColor) GetType() string {
|
|
return TypeAccentColor
|
|
}
|
|
|
|
// Contains information about supported accent colors for user profile photo background in RGB format
|
|
type ProfileAccentColors struct {
|
|
meta
|
|
// The list of 1-2 colors in RGB format, describing the colors, as expected to be shown in the color palette settings
|
|
PaletteColors []int32 `json:"palette_colors"`
|
|
// The list of 1-2 colors in RGB format, describing the colors, as expected to be used for the profile photo background
|
|
BackgroundColors []int32 `json:"background_colors"`
|
|
// The list of 2 colors in RGB format, describing the colors of the gradient to be used for the unread active story indicator around profile photo
|
|
StoryColors []int32 `json:"story_colors"`
|
|
}
|
|
|
|
func (entity *ProfileAccentColors) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ProfileAccentColors
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ProfileAccentColors) GetClass() string {
|
|
return ClassProfileAccentColors
|
|
}
|
|
|
|
func (*ProfileAccentColors) GetType() string {
|
|
return TypeProfileAccentColors
|
|
}
|
|
|
|
// Contains information about supported accent color for user profile photo background
|
|
type ProfileAccentColor struct {
|
|
meta
|
|
// Profile accent color identifier
|
|
Id int32 `json:"id"`
|
|
// Accent colors expected to be used in light themes
|
|
LightThemeColors *ProfileAccentColors `json:"light_theme_colors"`
|
|
// Accent colors expected to be used in dark themes
|
|
DarkThemeColors *ProfileAccentColors `json:"dark_theme_colors"`
|
|
// The minimum chat boost level required to use the color in a supergroup chat
|
|
MinSupergroupChatBoostLevel int32 `json:"min_supergroup_chat_boost_level"`
|
|
// The minimum chat boost level required to use the color in a channel chat
|
|
MinChannelChatBoostLevel int32 `json:"min_channel_chat_boost_level"`
|
|
}
|
|
|
|
func (entity *ProfileAccentColor) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ProfileAccentColor
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ProfileAccentColor) GetClass() string {
|
|
return ClassProfileAccentColor
|
|
}
|
|
|
|
func (*ProfileAccentColor) GetType() string {
|
|
return TypeProfileAccentColor
|
|
}
|
|
|
|
// 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"`
|
|
// Point in time (Unix timestamp) when the status will expire; 0 if never
|
|
ExpirationDate int32 `json:"expiration_date"`
|
|
}
|
|
|
|
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 custom emoji identifiers for emoji statuses
|
|
type EmojiStatuses struct {
|
|
meta
|
|
// The list of custom emoji identifiers
|
|
CustomEmojiIds []JsonInt64 `json:"custom_emoji_ids"`
|
|
}
|
|
|
|
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, reorderBotActiveUsernames or reorderSupergroupActiveUsernames
|
|
ActiveUsernames []string `json:"active_usernames"`
|
|
// List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive
|
|
DisabledUsernames []string `json:"disabled_usernames"`
|
|
// The active username, which can be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo
|
|
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"`
|
|
// Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview. For Telegram Premium users only
|
|
AccentColorId int32 `json:"accent_color_id"`
|
|
// Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. For Telegram Premium users only
|
|
BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"`
|
|
// Identifier of the accent color for the user's profile; -1 if none. For Telegram Premium users only
|
|
ProfileAccentColorId int32 `json:"profile_accent_color_id"`
|
|
// Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none. For Telegram Premium users only
|
|
ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"`
|
|
// 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"`
|
|
// The user is a close friend of the current user; implies that the user is a contact
|
|
IsCloseFriend bool `json:"is_close_friend"`
|
|
// 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"`
|
|
// True, if the user has non-expired stories available to the current user
|
|
HasActiveStories bool `json:"has_active_stories"`
|
|
// True, if the user has unread non-expired stories available to the current user
|
|
HasUnreadActiveStories bool `json:"has_unread_active_stories"`
|
|
// True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them
|
|
RestrictsNewChats bool `json:"restricts_new_chats"`
|
|
// 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
|
|
|
|
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 {
|
|
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"`
|
|
AccentColorId int32 `json:"accent_color_id"`
|
|
BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"`
|
|
ProfileAccentColorId int32 `json:"profile_accent_color_id"`
|
|
ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"`
|
|
EmojiStatus *EmojiStatus `json:"emoji_status"`
|
|
IsContact bool `json:"is_contact"`
|
|
IsMutualContact bool `json:"is_mutual_contact"`
|
|
IsCloseFriend bool `json:"is_close_friend"`
|
|
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"`
|
|
HasActiveStories bool `json:"has_active_stories"`
|
|
HasUnreadActiveStories bool `json:"has_unread_active_stories"`
|
|
RestrictsNewChats bool `json:"restricts_new_chats"`
|
|
HaveAccess bool `json:"have_access"`
|
|
Type json.RawMessage `json:"type"`
|
|
LanguageCode string `json:"language_code"`
|
|
AddedToAttachmentMenu bool `json:"added_to_attachment_menu"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
user.Id = tmp.Id
|
|
user.FirstName = tmp.FirstName
|
|
user.LastName = tmp.LastName
|
|
user.Usernames = tmp.Usernames
|
|
user.PhoneNumber = tmp.PhoneNumber
|
|
user.ProfilePhoto = tmp.ProfilePhoto
|
|
user.AccentColorId = tmp.AccentColorId
|
|
user.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId
|
|
user.ProfileAccentColorId = tmp.ProfileAccentColorId
|
|
user.ProfileBackgroundCustomEmojiId = tmp.ProfileBackgroundCustomEmojiId
|
|
user.EmojiStatus = tmp.EmojiStatus
|
|
user.IsContact = tmp.IsContact
|
|
user.IsMutualContact = tmp.IsMutualContact
|
|
user.IsCloseFriend = tmp.IsCloseFriend
|
|
user.IsVerified = tmp.IsVerified
|
|
user.IsPremium = tmp.IsPremium
|
|
user.IsSupport = tmp.IsSupport
|
|
user.RestrictionReason = tmp.RestrictionReason
|
|
user.IsScam = tmp.IsScam
|
|
user.IsFake = tmp.IsFake
|
|
user.HasActiveStories = tmp.HasActiveStories
|
|
user.HasUnreadActiveStories = tmp.HasUnreadActiveStories
|
|
user.RestrictsNewChats = tmp.RestrictsNewChats
|
|
user.HaveAccess = tmp.HaveAccess
|
|
user.LanguageCode = tmp.LanguageCode
|
|
user.AddedToAttachmentMenu = tmp.AddedToAttachmentMenu
|
|
|
|
fieldStatus, _ := UnmarshalUserStatus(tmp.Status)
|
|
user.Status = fieldStatus
|
|
|
|
fieldType, _ := UnmarshalUserType(tmp.Type)
|
|
user.Type = fieldType
|
|
|
|
return nil
|
|
}
|
|
|
|
// 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
|
|
ShortDescription string `json:"short_description"`
|
|
// 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"`
|
|
// The internal link, which can be used to edit bot commands; may be null
|
|
EditCommandsLink InternalLinkType `json:"edit_commands_link"`
|
|
// The internal link, which can be used to edit bot description; may be null
|
|
EditDescriptionLink InternalLinkType `json:"edit_description_link"`
|
|
// The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null
|
|
EditDescriptionMediaLink InternalLinkType `json:"edit_description_media_link"`
|
|
// The internal link, which can be used to edit bot settings; may be null
|
|
EditSettingsLink InternalLinkType `json:"edit_settings_link"`
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
func (botInfo *BotInfo) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
ShortDescription string `json:"short_description"`
|
|
Description string `json:"description"`
|
|
Photo *Photo `json:"photo"`
|
|
Animation *Animation `json:"animation"`
|
|
MenuButton *BotMenuButton `json:"menu_button"`
|
|
Commands []*BotCommand `json:"commands"`
|
|
DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"`
|
|
DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"`
|
|
EditCommandsLink json.RawMessage `json:"edit_commands_link"`
|
|
EditDescriptionLink json.RawMessage `json:"edit_description_link"`
|
|
EditDescriptionMediaLink json.RawMessage `json:"edit_description_media_link"`
|
|
EditSettingsLink json.RawMessage `json:"edit_settings_link"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
botInfo.ShortDescription = tmp.ShortDescription
|
|
botInfo.Description = tmp.Description
|
|
botInfo.Photo = tmp.Photo
|
|
botInfo.Animation = tmp.Animation
|
|
botInfo.MenuButton = tmp.MenuButton
|
|
botInfo.Commands = tmp.Commands
|
|
botInfo.DefaultGroupAdministratorRights = tmp.DefaultGroupAdministratorRights
|
|
botInfo.DefaultChannelAdministratorRights = tmp.DefaultChannelAdministratorRights
|
|
|
|
fieldEditCommandsLink, _ := UnmarshalInternalLinkType(tmp.EditCommandsLink)
|
|
botInfo.EditCommandsLink = fieldEditCommandsLink
|
|
|
|
fieldEditDescriptionLink, _ := UnmarshalInternalLinkType(tmp.EditDescriptionLink)
|
|
botInfo.EditDescriptionLink = fieldEditDescriptionLink
|
|
|
|
fieldEditDescriptionMediaLink, _ := UnmarshalInternalLinkType(tmp.EditDescriptionMediaLink)
|
|
botInfo.EditDescriptionMediaLink = fieldEditDescriptionMediaLink
|
|
|
|
fieldEditSettingsLink, _ := UnmarshalInternalLinkType(tmp.EditSettingsLink)
|
|
botInfo.EditSettingsLink = fieldEditSettingsLink
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains full information about a user
|
|
type UserFullInfo struct {
|
|
meta
|
|
// 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, it is 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, it is unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo
|
|
Photo *ChatPhoto `json:"photo"`
|
|
// 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, it is 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"`
|
|
// Block list to which the user is added; may be null if none
|
|
BlockList BlockList `json:"block_list"`
|
|
// 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"`
|
|
// True, if the user can't be linked in forwarded messages due to their privacy settings
|
|
HasPrivateForwards bool `json:"has_private_forwards"`
|
|
// 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"`
|
|
// True, if the user has pinned stories
|
|
HasPinnedStories bool `json:"has_pinned_stories"`
|
|
// 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"`
|
|
// True, if the user set chat background for both chat users and it wasn't reverted yet
|
|
SetChatBackground bool `json:"set_chat_background"`
|
|
// A short user bio; may be null for bots
|
|
Bio *FormattedText `json:"bio"`
|
|
// Birthdate of the user; may be null if unknown
|
|
Birthdate *Birthdate `json:"birthdate"`
|
|
// Identifier of the personal chat of the user; 0 if none
|
|
PersonalChatId int64 `json:"personal_chat_id"`
|
|
// The list of available options for gifting Telegram Premium to the user
|
|
PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"`
|
|
// Number of 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"`
|
|
// Information about business settings for Telegram Business accounts; may be null if none
|
|
BusinessInfo *BusinessInfo `json:"business_info"`
|
|
// For bots, information about the bot; may be null if the user isn't a bot
|
|
BotInfo *BotInfo `json:"bot_info"`
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
PersonalPhoto *ChatPhoto `json:"personal_photo"`
|
|
Photo *ChatPhoto `json:"photo"`
|
|
PublicPhoto *ChatPhoto `json:"public_photo"`
|
|
BlockList json.RawMessage `json:"block_list"`
|
|
CanBeCalled bool `json:"can_be_called"`
|
|
SupportsVideoCalls bool `json:"supports_video_calls"`
|
|
HasPrivateCalls bool `json:"has_private_calls"`
|
|
HasPrivateForwards bool `json:"has_private_forwards"`
|
|
HasRestrictedVoiceAndVideoNoteMessages bool `json:"has_restricted_voice_and_video_note_messages"`
|
|
HasPinnedStories bool `json:"has_pinned_stories"`
|
|
NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"`
|
|
SetChatBackground bool `json:"set_chat_background"`
|
|
Bio *FormattedText `json:"bio"`
|
|
Birthdate *Birthdate `json:"birthdate"`
|
|
PersonalChatId int64 `json:"personal_chat_id"`
|
|
PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"`
|
|
GroupInCommonCount int32 `json:"group_in_common_count"`
|
|
BusinessInfo *BusinessInfo `json:"business_info"`
|
|
BotInfo *BotInfo `json:"bot_info"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
userFullInfo.PersonalPhoto = tmp.PersonalPhoto
|
|
userFullInfo.Photo = tmp.Photo
|
|
userFullInfo.PublicPhoto = tmp.PublicPhoto
|
|
userFullInfo.CanBeCalled = tmp.CanBeCalled
|
|
userFullInfo.SupportsVideoCalls = tmp.SupportsVideoCalls
|
|
userFullInfo.HasPrivateCalls = tmp.HasPrivateCalls
|
|
userFullInfo.HasPrivateForwards = tmp.HasPrivateForwards
|
|
userFullInfo.HasRestrictedVoiceAndVideoNoteMessages = tmp.HasRestrictedVoiceAndVideoNoteMessages
|
|
userFullInfo.HasPinnedStories = tmp.HasPinnedStories
|
|
userFullInfo.NeedPhoneNumberPrivacyException = tmp.NeedPhoneNumberPrivacyException
|
|
userFullInfo.SetChatBackground = tmp.SetChatBackground
|
|
userFullInfo.Bio = tmp.Bio
|
|
userFullInfo.Birthdate = tmp.Birthdate
|
|
userFullInfo.PersonalChatId = tmp.PersonalChatId
|
|
userFullInfo.PremiumGiftOptions = tmp.PremiumGiftOptions
|
|
userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount
|
|
userFullInfo.BusinessInfo = tmp.BusinessInfo
|
|
userFullInfo.BotInfo = tmp.BotInfo
|
|
|
|
fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList)
|
|
userFullInfo.BlockList = fieldBlockList
|
|
|
|
return nil
|
|
}
|
|
|
|
// Represents a list of users
|
|
type Users struct {
|
|
meta
|
|
// Approximate total number of users found
|
|
TotalCount int32 `json:"total_count"`
|
|
// A list of user identifiers
|
|
UserIds []int64 `json:"user_ids"`
|
|
}
|
|
|
|
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
|
|
UserId int64 `json:"user_id"`
|
|
// 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
|
|
}
|
|
|
|
// The user is the owner of the chat and has all the administrator privileges
|
|
type ChatMemberStatusCreator struct {
|
|
meta
|
|
// A custom title of the owner; 0-16 characters without 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
|
|
}
|
|
|
|
// The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. In supergroups and channels, there are more detailed options for administrator privileges
|
|
type ChatMemberStatusAdministrator struct {
|
|
meta
|
|
// A custom title of the administrator; 0-16 characters without 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"`
|
|
// Rights of the administrator
|
|
Rights *ChatAdministratorRights `json:"rights"`
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// The user is a member of the chat, without any additional privileges or restrictions
|
|
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
|
|
}
|
|
|
|
// The user or the chat is not a chat member
|
|
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
|
|
}
|
|
|
|
// 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
|
|
type ChatMemberStatusBanned struct {
|
|
meta
|
|
// 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
|
|
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
|
|
}
|
|
|
|
// Describes a user or a chat as a member of another chat
|
|
type ChatMember struct {
|
|
meta
|
|
// Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels
|
|
MemberId MessageSender `json:"member_id"`
|
|
// Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown
|
|
InviterUserId int64 `json:"inviter_user_id"`
|
|
// Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat
|
|
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 {
|
|
MemberId json.RawMessage `json:"member_id"`
|
|
InviterUserId int64 `json:"inviter_user_id"`
|
|
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
|
|
|
|
fieldMemberId, _ := UnmarshalMessageSender(tmp.MemberId)
|
|
chatMember.MemberId = fieldMemberId
|
|
|
|
fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status)
|
|
chatMember.Status = fieldStatus
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains a list of chat members
|
|
type ChatMembers struct {
|
|
meta
|
|
// Approximate total number of chat members found
|
|
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
|
|
}
|
|
|
|
// Contains a chat invite link
|
|
type ChatInviteLink struct {
|
|
meta
|
|
// 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
|
|
ExpirationDate int32 `json:"expiration_date"`
|
|
// 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
|
|
MemberCount int32 `json:"member_count"`
|
|
// 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"`
|
|
// 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
|
|
IsPrimary bool `json:"is_primary"`
|
|
// True, if the link was revoked
|
|
IsRevoked bool `json:"is_revoked"`
|
|
}
|
|
|
|
func (entity *ChatInviteLink) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatInviteLink
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatInviteLink) GetClass() string {
|
|
return ClassChatInviteLink
|
|
}
|
|
|
|
func (*ChatInviteLink) GetType() string {
|
|
return TypeChatInviteLink
|
|
}
|
|
|
|
// Contains a list of chat invite links
|
|
type ChatInviteLinks struct {
|
|
meta
|
|
// Approximate total number of chat invite links found
|
|
TotalCount int32 `json:"total_count"`
|
|
// List of invite links
|
|
InviteLinks []*ChatInviteLink `json:"invite_links"`
|
|
}
|
|
|
|
func (entity *ChatInviteLinks) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatInviteLinks
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatInviteLinks) GetClass() string {
|
|
return ClassChatInviteLinks
|
|
}
|
|
|
|
func (*ChatInviteLinks) GetType() string {
|
|
return TypeChatInviteLinks
|
|
}
|
|
|
|
// Describes a chat administrator with a number of active and revoked chat invite links
|
|
type ChatInviteLinkCount struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *ChatInviteLinkCount) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatInviteLinkCount
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatInviteLinkCount) GetClass() string {
|
|
return ClassChatInviteLinkCount
|
|
}
|
|
|
|
func (*ChatInviteLinkCount) GetType() string {
|
|
return TypeChatInviteLinkCount
|
|
}
|
|
|
|
// Contains a list of chat invite link counts
|
|
type ChatInviteLinkCounts struct {
|
|
meta
|
|
// List of invite link counts
|
|
InviteLinkCounts []*ChatInviteLinkCount `json:"invite_link_counts"`
|
|
}
|
|
|
|
func (entity *ChatInviteLinkCounts) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatInviteLinkCounts
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatInviteLinkCounts) GetClass() string {
|
|
return ClassChatInviteLinkCounts
|
|
}
|
|
|
|
func (*ChatInviteLinkCounts) GetType() string {
|
|
return TypeChatInviteLinkCounts
|
|
}
|
|
|
|
// Describes a chat member joined a chat via an invite link
|
|
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"`
|
|
// True, if the user has joined the chat using an invite link for a chat folder
|
|
ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link"`
|
|
// User identifier of the chat administrator, approved user join request
|
|
ApproverUserId int64 `json:"approver_user_id"`
|
|
}
|
|
|
|
func (entity *ChatInviteLinkMember) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatInviteLinkMember
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatInviteLinkMember) GetClass() string {
|
|
return ClassChatInviteLinkMember
|
|
}
|
|
|
|
func (*ChatInviteLinkMember) GetType() string {
|
|
return TypeChatInviteLinkMember
|
|
}
|
|
|
|
// Contains a list of chat members joined a chat via an invite link
|
|
type ChatInviteLinkMembers struct {
|
|
meta
|
|
// Approximate total number of chat members found
|
|
TotalCount int32 `json:"total_count"`
|
|
// List of chat members, joined a chat via an invite link
|
|
Members []*ChatInviteLinkMember `json:"members"`
|
|
}
|
|
|
|
func (entity *ChatInviteLinkMembers) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatInviteLinkMembers
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatInviteLinkMembers) GetClass() string {
|
|
return ClassChatInviteLinkMembers
|
|
}
|
|
|
|
func (*ChatInviteLinkMembers) GetType() string {
|
|
return TypeChatInviteLinkMembers
|
|
}
|
|
|
|
// The link is an invite link for a basic group
|
|
type InviteLinkChatTypeBasicGroup struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *InviteLinkChatTypeBasicGroup) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InviteLinkChatTypeBasicGroup
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InviteLinkChatTypeBasicGroup) GetClass() string {
|
|
return ClassInviteLinkChatType
|
|
}
|
|
|
|
func (*InviteLinkChatTypeBasicGroup) GetType() string {
|
|
return TypeInviteLinkChatTypeBasicGroup
|
|
}
|
|
|
|
func (*InviteLinkChatTypeBasicGroup) InviteLinkChatTypeType() string {
|
|
return TypeInviteLinkChatTypeBasicGroup
|
|
}
|
|
|
|
// The link is an invite link for a supergroup
|
|
type InviteLinkChatTypeSupergroup struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *InviteLinkChatTypeSupergroup) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InviteLinkChatTypeSupergroup
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InviteLinkChatTypeSupergroup) GetClass() string {
|
|
return ClassInviteLinkChatType
|
|
}
|
|
|
|
func (*InviteLinkChatTypeSupergroup) GetType() string {
|
|
return TypeInviteLinkChatTypeSupergroup
|
|
}
|
|
|
|
func (*InviteLinkChatTypeSupergroup) InviteLinkChatTypeType() string {
|
|
return TypeInviteLinkChatTypeSupergroup
|
|
}
|
|
|
|
// The link is an invite link for a channel
|
|
type InviteLinkChatTypeChannel struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *InviteLinkChatTypeChannel) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InviteLinkChatTypeChannel
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InviteLinkChatTypeChannel) GetClass() string {
|
|
return ClassInviteLinkChatType
|
|
}
|
|
|
|
func (*InviteLinkChatTypeChannel) GetType() string {
|
|
return TypeInviteLinkChatTypeChannel
|
|
}
|
|
|
|
func (*InviteLinkChatTypeChannel) InviteLinkChatTypeType() string {
|
|
return TypeInviteLinkChatTypeChannel
|
|
}
|
|
|
|
// Contains information about a chat invite link
|
|
type ChatInviteLinkInfo struct {
|
|
meta
|
|
// 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 InviteLinkChatType `json:"type"`
|
|
// Title of the chat
|
|
Title string `json:"title"`
|
|
// Chat photo; may be null
|
|
Photo *ChatPhotoInfo `json:"photo"`
|
|
// Identifier of the accent color for chat title and background of chat photo
|
|
AccentColorId int32 `json:"accent_color_id"`
|
|
// 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"`
|
|
// True, if the chat is verified
|
|
IsVerified bool `json:"is_verified"`
|
|
// True, if many users reported this chat as a scam
|
|
IsScam bool `json:"is_scam"`
|
|
// True, if many users reported this chat as a fake account
|
|
IsFake bool `json:"is_fake"`
|
|
}
|
|
|
|
func (entity *ChatInviteLinkInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatInviteLinkInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatInviteLinkInfo) GetClass() string {
|
|
return ClassChatInviteLinkInfo
|
|
}
|
|
|
|
func (*ChatInviteLinkInfo) GetType() string {
|
|
return TypeChatInviteLinkInfo
|
|
}
|
|
|
|
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"`
|
|
AccentColorId int32 `json:"accent_color_id"`
|
|
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"`
|
|
IsVerified bool `json:"is_verified"`
|
|
IsScam bool `json:"is_scam"`
|
|
IsFake bool `json:"is_fake"`
|
|
}
|
|
|
|
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.AccentColorId = tmp.AccentColorId
|
|
chatInviteLinkInfo.Description = tmp.Description
|
|
chatInviteLinkInfo.MemberCount = tmp.MemberCount
|
|
chatInviteLinkInfo.MemberUserIds = tmp.MemberUserIds
|
|
chatInviteLinkInfo.CreatesJoinRequest = tmp.CreatesJoinRequest
|
|
chatInviteLinkInfo.IsPublic = tmp.IsPublic
|
|
chatInviteLinkInfo.IsVerified = tmp.IsVerified
|
|
chatInviteLinkInfo.IsScam = tmp.IsScam
|
|
chatInviteLinkInfo.IsFake = tmp.IsFake
|
|
|
|
fieldType, _ := UnmarshalInviteLinkChatType(tmp.Type)
|
|
chatInviteLinkInfo.Type = fieldType
|
|
|
|
return nil
|
|
}
|
|
|
|
// Describes a user that sent a join request and waits for administrator approval
|
|
type ChatJoinRequest struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *ChatJoinRequest) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatJoinRequest
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatJoinRequest) GetClass() string {
|
|
return ClassChatJoinRequest
|
|
}
|
|
|
|
func (*ChatJoinRequest) GetType() string {
|
|
return TypeChatJoinRequest
|
|
}
|
|
|
|
// Contains a list of requests to join a chat
|
|
type ChatJoinRequests struct {
|
|
meta
|
|
// Approximate total number of requests found
|
|
TotalCount int32 `json:"total_count"`
|
|
// List of the requests
|
|
Requests []*ChatJoinRequest `json:"requests"`
|
|
}
|
|
|
|
func (entity *ChatJoinRequests) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatJoinRequests
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatJoinRequests) GetClass() string {
|
|
return ClassChatJoinRequests
|
|
}
|
|
|
|
func (*ChatJoinRequests) GetType() string {
|
|
return TypeChatJoinRequests
|
|
}
|
|
|
|
// Contains information about pending join requests for a chat
|
|
type ChatJoinRequestsInfo struct {
|
|
meta
|
|
// Total number of pending join requests
|
|
TotalCount int32 `json:"total_count"`
|
|
// Identifiers of at most 3 users sent the newest pending join requests
|
|
UserIds []int64 `json:"user_ids"`
|
|
}
|
|
|
|
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 {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *BasicGroup) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BasicGroup
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BasicGroup) GetClass() string {
|
|
return ClassBasicGroup
|
|
}
|
|
|
|
func (*BasicGroup) GetType() string {
|
|
return TypeBasicGroup
|
|
}
|
|
|
|
func (basicGroup *BasicGroup) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
basicGroup.Id = tmp.Id
|
|
basicGroup.MemberCount = tmp.MemberCount
|
|
basicGroup.IsActive = tmp.IsActive
|
|
basicGroup.UpgradedToSupergroupId = tmp.UpgradedToSupergroupId
|
|
|
|
fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status)
|
|
basicGroup.Status = fieldStatus
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains full information about a basic group
|
|
type BasicGroupFullInfo struct {
|
|
meta
|
|
// Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
|
|
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"`
|
|
// 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"`
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *BasicGroupFullInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BasicGroupFullInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BasicGroupFullInfo) GetClass() string {
|
|
return ClassBasicGroupFullInfo
|
|
}
|
|
|
|
func (*BasicGroupFullInfo) GetType() string {
|
|
return TypeBasicGroupFullInfo
|
|
}
|
|
|
|
// 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 {
|
|
meta
|
|
// Supergroup or channel identifier
|
|
Id int64 `json:"id"`
|
|
// Usernames of the supergroup or channel; may be null
|
|
Usernames *Usernames `json:"usernames"`
|
|
// Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member
|
|
Date int32 `json:"date"`
|
|
// Status of the current user in the supergroup or channel; custom title will always be empty
|
|
Status ChatMemberStatus `json:"status"`
|
|
// Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchChatsNearby, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or for public chats in which where sent messages and posted stories from publicForwards, or for public chats in which where sent messages from getMessagePublicForwards response
|
|
MemberCount int32 `json:"member_count"`
|
|
// Approximate boost level for the chat
|
|
BoostLevel int32 `json:"boost_level"`
|
|
// 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"`
|
|
// 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"`
|
|
// 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"`
|
|
// 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
|
|
IsBroadcastGroup bool `json:"is_broadcast_group"`
|
|
// True, if the supergroup is a forum with topics
|
|
IsForum bool `json:"is_forum"`
|
|
// 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"`
|
|
// True, if the supergroup or channel has non-expired stories available to the current user
|
|
HasActiveStories bool `json:"has_active_stories"`
|
|
// True, if the supergroup or channel has unread non-expired stories available to the current user
|
|
HasUnreadActiveStories bool `json:"has_unread_active_stories"`
|
|
}
|
|
|
|
func (entity *Supergroup) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub Supergroup
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*Supergroup) GetClass() string {
|
|
return ClassSupergroup
|
|
}
|
|
|
|
func (*Supergroup) GetType() string {
|
|
return TypeSupergroup
|
|
}
|
|
|
|
func (supergroup *Supergroup) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Id int64 `json:"id"`
|
|
Usernames *Usernames `json:"usernames"`
|
|
Date int32 `json:"date"`
|
|
Status json.RawMessage `json:"status"`
|
|
MemberCount int32 `json:"member_count"`
|
|
BoostLevel int32 `json:"boost_level"`
|
|
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"`
|
|
HasActiveStories bool `json:"has_active_stories"`
|
|
HasUnreadActiveStories bool `json:"has_unread_active_stories"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
supergroup.Id = tmp.Id
|
|
supergroup.Usernames = tmp.Usernames
|
|
supergroup.Date = tmp.Date
|
|
supergroup.MemberCount = tmp.MemberCount
|
|
supergroup.BoostLevel = tmp.BoostLevel
|
|
supergroup.HasLinkedChat = tmp.HasLinkedChat
|
|
supergroup.HasLocation = tmp.HasLocation
|
|
supergroup.SignMessages = tmp.SignMessages
|
|
supergroup.JoinToSendMessages = tmp.JoinToSendMessages
|
|
supergroup.JoinByRequest = tmp.JoinByRequest
|
|
supergroup.IsSlowModeEnabled = tmp.IsSlowModeEnabled
|
|
supergroup.IsChannel = tmp.IsChannel
|
|
supergroup.IsBroadcastGroup = tmp.IsBroadcastGroup
|
|
supergroup.IsForum = tmp.IsForum
|
|
supergroup.IsVerified = tmp.IsVerified
|
|
supergroup.RestrictionReason = tmp.RestrictionReason
|
|
supergroup.IsScam = tmp.IsScam
|
|
supergroup.IsFake = tmp.IsFake
|
|
supergroup.HasActiveStories = tmp.HasActiveStories
|
|
supergroup.HasUnreadActiveStories = tmp.HasUnreadActiveStories
|
|
|
|
fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status)
|
|
supergroup.Status = fieldStatus
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains full information about a supergroup or channel
|
|
type SupergroupFullInfo struct {
|
|
meta
|
|
// Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
|
|
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"`
|
|
// True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers
|
|
CanGetMembers bool `json:"can_get_members"`
|
|
// 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"`
|
|
// 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"`
|
|
// 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
|
|
IsAllHistoryAvailable bool `json:"is_all_history_available"`
|
|
// 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"`
|
|
// True, if the supergroup or channel has pinned stories
|
|
HasPinnedStories bool `json:"has_pinned_stories"`
|
|
// Number of times the current user boosted the supergroup or channel
|
|
MyBoostCount int32 `json:"my_boost_count"`
|
|
// Number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; 0 if unspecified
|
|
UnrestrictBoostCount int32 `json:"unrestrict_boost_count"`
|
|
// Identifier of the supergroup sticker set that must be shown before user sticker sets; 0 if none
|
|
StickerSetId JsonInt64 `json:"sticker_set_id"`
|
|
// Identifier of the custom emoji sticker set that can be used in the supergroup without Telegram Premium subscription; 0 if none
|
|
CustomEmojiStickerSetId JsonInt64 `json:"custom_emoji_sticker_set_id"`
|
|
// Location to which the supergroup is connected; may be null if none
|
|
Location *ChatLocation `json:"location"`
|
|
// Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only
|
|
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"`
|
|
}
|
|
|
|
func (entity *SupergroupFullInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SupergroupFullInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SupergroupFullInfo) GetClass() string {
|
|
return ClassSupergroupFullInfo
|
|
}
|
|
|
|
func (*SupergroupFullInfo) GetType() string {
|
|
return TypeSupergroupFullInfo
|
|
}
|
|
|
|
// The secret chat is not yet created; waiting for the other user to get online
|
|
type SecretChatStatePending struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *SecretChatStatePending) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SecretChatStatePending
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SecretChatStatePending) GetClass() string {
|
|
return ClassSecretChatState
|
|
}
|
|
|
|
func (*SecretChatStatePending) GetType() string {
|
|
return TypeSecretChatStatePending
|
|
}
|
|
|
|
func (*SecretChatStatePending) SecretChatStateType() string {
|
|
return TypeSecretChatStatePending
|
|
}
|
|
|
|
// The secret chat is ready to use
|
|
type SecretChatStateReady struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *SecretChatStateReady) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SecretChatStateReady
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SecretChatStateReady) GetClass() string {
|
|
return ClassSecretChatState
|
|
}
|
|
|
|
func (*SecretChatStateReady) GetType() string {
|
|
return TypeSecretChatStateReady
|
|
}
|
|
|
|
func (*SecretChatStateReady) SecretChatStateType() string {
|
|
return TypeSecretChatStateReady
|
|
}
|
|
|
|
// The secret chat is closed
|
|
type SecretChatStateClosed struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *SecretChatStateClosed) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SecretChatStateClosed
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SecretChatStateClosed) GetClass() string {
|
|
return ClassSecretChatState
|
|
}
|
|
|
|
func (*SecretChatStateClosed) GetType() string {
|
|
return TypeSecretChatStateClosed
|
|
}
|
|
|
|
func (*SecretChatStateClosed) SecretChatStateType() string {
|
|
return TypeSecretChatStateClosed
|
|
}
|
|
|
|
// Represents a secret chat
|
|
type SecretChat struct {
|
|
meta
|
|
// 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; false otherwise
|
|
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"`
|
|
// 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
|
|
Layer int32 `json:"layer"`
|
|
}
|
|
|
|
func (entity *SecretChat) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SecretChat
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SecretChat) GetClass() string {
|
|
return ClassSecretChat
|
|
}
|
|
|
|
func (*SecretChat) GetType() string {
|
|
return TypeSecretChat
|
|
}
|
|
|
|
func (secretChat *SecretChat) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
secretChat.Id = tmp.Id
|
|
secretChat.UserId = tmp.UserId
|
|
secretChat.IsOutbound = tmp.IsOutbound
|
|
secretChat.KeyHash = tmp.KeyHash
|
|
secretChat.Layer = tmp.Layer
|
|
|
|
fieldState, _ := UnmarshalSecretChatState(tmp.State)
|
|
secretChat.State = fieldState
|
|
|
|
return nil
|
|
}
|
|
|
|
// The message was sent by a known user
|
|
type MessageSenderUser struct {
|
|
meta
|
|
// Identifier of the user that sent the message
|
|
UserId int64 `json:"user_id"`
|
|
}
|
|
|
|
func (entity *MessageSenderUser) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSenderUser
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSenderUser) GetClass() string {
|
|
return ClassMessageSender
|
|
}
|
|
|
|
func (*MessageSenderUser) GetType() string {
|
|
return TypeMessageSenderUser
|
|
}
|
|
|
|
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
|
|
// Approximate total number of messages senders found
|
|
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 {
|
|
var tmp struct {
|
|
TotalCount int32 `json:"total_count"`
|
|
Senders []json.RawMessage `json:"senders"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
messageSenders.TotalCount = tmp.TotalCount
|
|
|
|
fieldSenders, _ := UnmarshalListOfMessageSender(tmp.Senders)
|
|
messageSenders.Senders = fieldSenders
|
|
|
|
return nil
|
|
}
|
|
|
|
// Represents a message sender, which can be used to send messages in a chat
|
|
type ChatMessageSender struct {
|
|
meta
|
|
// The message sender
|
|
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
|
|
}
|
|
|
|
// Contains read date of the message
|
|
type MessageReadDateRead struct {
|
|
meta
|
|
// Point in time (Unix timestamp) when the message was read by the other user
|
|
ReadDate int32 `json:"read_date"`
|
|
}
|
|
|
|
func (entity *MessageReadDateRead) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageReadDateRead
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageReadDateRead) GetClass() string {
|
|
return ClassMessageReadDate
|
|
}
|
|
|
|
func (*MessageReadDateRead) GetType() string {
|
|
return TypeMessageReadDateRead
|
|
}
|
|
|
|
func (*MessageReadDateRead) MessageReadDateType() string {
|
|
return TypeMessageReadDateRead
|
|
}
|
|
|
|
// The message is unread yet
|
|
type MessageReadDateUnread struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageReadDateUnread) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageReadDateUnread
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageReadDateUnread) GetClass() string {
|
|
return ClassMessageReadDate
|
|
}
|
|
|
|
func (*MessageReadDateUnread) GetType() string {
|
|
return TypeMessageReadDateUnread
|
|
}
|
|
|
|
func (*MessageReadDateUnread) MessageReadDateType() string {
|
|
return TypeMessageReadDateUnread
|
|
}
|
|
|
|
// The message is too old to get read date
|
|
type MessageReadDateTooOld struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageReadDateTooOld) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageReadDateTooOld
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageReadDateTooOld) GetClass() string {
|
|
return ClassMessageReadDate
|
|
}
|
|
|
|
func (*MessageReadDateTooOld) GetType() string {
|
|
return TypeMessageReadDateTooOld
|
|
}
|
|
|
|
func (*MessageReadDateTooOld) MessageReadDateType() string {
|
|
return TypeMessageReadDateTooOld
|
|
}
|
|
|
|
// The read date is unknown due to privacy settings of the other user
|
|
type MessageReadDateUserPrivacyRestricted struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageReadDateUserPrivacyRestricted) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageReadDateUserPrivacyRestricted
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageReadDateUserPrivacyRestricted) GetClass() string {
|
|
return ClassMessageReadDate
|
|
}
|
|
|
|
func (*MessageReadDateUserPrivacyRestricted) GetType() string {
|
|
return TypeMessageReadDateUserPrivacyRestricted
|
|
}
|
|
|
|
func (*MessageReadDateUserPrivacyRestricted) MessageReadDateType() string {
|
|
return TypeMessageReadDateUserPrivacyRestricted
|
|
}
|
|
|
|
// The read date is unknown due to privacy settings of the current user, but will be known if the user subscribes to Telegram Premium
|
|
type MessageReadDateMyPrivacyRestricted struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageReadDateMyPrivacyRestricted) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageReadDateMyPrivacyRestricted
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageReadDateMyPrivacyRestricted) GetClass() string {
|
|
return ClassMessageReadDate
|
|
}
|
|
|
|
func (*MessageReadDateMyPrivacyRestricted) GetType() string {
|
|
return TypeMessageReadDateMyPrivacyRestricted
|
|
}
|
|
|
|
func (*MessageReadDateMyPrivacyRestricted) MessageReadDateType() string {
|
|
return TypeMessageReadDateMyPrivacyRestricted
|
|
}
|
|
|
|
// Represents a viewer of a message
|
|
type MessageViewer struct {
|
|
meta
|
|
// User identifier of the viewer
|
|
UserId int64 `json:"user_id"`
|
|
// Approximate point in time (Unix timestamp) when the message was viewed
|
|
ViewDate int32 `json:"view_date"`
|
|
}
|
|
|
|
func (entity *MessageViewer) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageViewer
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageViewer) GetClass() string {
|
|
return ClassMessageViewer
|
|
}
|
|
|
|
func (*MessageViewer) GetType() string {
|
|
return TypeMessageViewer
|
|
}
|
|
|
|
// Represents a list of message viewers
|
|
type MessageViewers struct {
|
|
meta
|
|
// List of message viewers
|
|
Viewers []*MessageViewer `json:"viewers"`
|
|
}
|
|
|
|
func (entity *MessageViewers) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageViewers
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageViewers) GetClass() string {
|
|
return ClassMessageViewers
|
|
}
|
|
|
|
func (*MessageViewers) GetType() string {
|
|
return TypeMessageViewers
|
|
}
|
|
|
|
// The message was originally sent by a known user
|
|
type MessageOriginUser struct {
|
|
meta
|
|
// Identifier of the user that originally sent the message
|
|
SenderUserId int64 `json:"sender_user_id"`
|
|
}
|
|
|
|
func (entity *MessageOriginUser) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageOriginUser
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageOriginUser) GetClass() string {
|
|
return ClassMessageOrigin
|
|
}
|
|
|
|
func (*MessageOriginUser) GetType() string {
|
|
return TypeMessageOriginUser
|
|
}
|
|
|
|
func (*MessageOriginUser) MessageOriginType() string {
|
|
return TypeMessageOriginUser
|
|
}
|
|
|
|
// The message was originally sent by a user, which is hidden by their privacy settings
|
|
type MessageOriginHiddenUser struct {
|
|
meta
|
|
// Name of the sender
|
|
SenderName string `json:"sender_name"`
|
|
}
|
|
|
|
func (entity *MessageOriginHiddenUser) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageOriginHiddenUser
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageOriginHiddenUser) GetClass() string {
|
|
return ClassMessageOrigin
|
|
}
|
|
|
|
func (*MessageOriginHiddenUser) GetType() string {
|
|
return TypeMessageOriginHiddenUser
|
|
}
|
|
|
|
func (*MessageOriginHiddenUser) MessageOriginType() string {
|
|
return TypeMessageOriginHiddenUser
|
|
}
|
|
|
|
// The message was originally sent on behalf of a chat
|
|
type MessageOriginChat struct {
|
|
meta
|
|
// Identifier of the chat that originally sent the message
|
|
SenderChatId int64 `json:"sender_chat_id"`
|
|
// For messages originally sent by an anonymous chat administrator, original message author signature
|
|
AuthorSignature string `json:"author_signature"`
|
|
}
|
|
|
|
func (entity *MessageOriginChat) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageOriginChat
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageOriginChat) GetClass() string {
|
|
return ClassMessageOrigin
|
|
}
|
|
|
|
func (*MessageOriginChat) GetType() string {
|
|
return TypeMessageOriginChat
|
|
}
|
|
|
|
func (*MessageOriginChat) MessageOriginType() string {
|
|
return TypeMessageOriginChat
|
|
}
|
|
|
|
// The message was originally a post in a channel
|
|
type MessageOriginChannel struct {
|
|
meta
|
|
// Identifier of the channel chat to which the message was originally sent
|
|
ChatId int64 `json:"chat_id"`
|
|
// Message identifier of the original message
|
|
MessageId int64 `json:"message_id"`
|
|
// Original post author signature
|
|
AuthorSignature string `json:"author_signature"`
|
|
}
|
|
|
|
func (entity *MessageOriginChannel) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageOriginChannel
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageOriginChannel) GetClass() string {
|
|
return ClassMessageOrigin
|
|
}
|
|
|
|
func (*MessageOriginChannel) GetType() string {
|
|
return TypeMessageOriginChannel
|
|
}
|
|
|
|
func (*MessageOriginChannel) MessageOriginType() string {
|
|
return TypeMessageOriginChannel
|
|
}
|
|
|
|
// Contains information about the last message from which a new message was forwarded last time
|
|
type ForwardSource struct {
|
|
meta
|
|
// Identifier of the chat to which the message that was forwarded belonged; may be 0 if unknown
|
|
ChatId int64 `json:"chat_id"`
|
|
// Identifier of the message; may be 0 if unknown
|
|
MessageId int64 `json:"message_id"`
|
|
// Identifier of the sender of the message; may be null if unknown or the new message was forwarded not to Saved Messages
|
|
SenderId MessageSender `json:"sender_id"`
|
|
// Name of the sender of the message if the sender is hidden by their privacy settings
|
|
SenderName string `json:"sender_name"`
|
|
// Point in time (Unix timestamp) when the message is sent; 0 if unknown
|
|
Date int32 `json:"date"`
|
|
// True, if the message that was forwarded is outgoing; always false if sender is unknown
|
|
IsOutgoing bool `json:"is_outgoing"`
|
|
}
|
|
|
|
func (entity *ForwardSource) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ForwardSource
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ForwardSource) GetClass() string {
|
|
return ClassForwardSource
|
|
}
|
|
|
|
func (*ForwardSource) GetType() string {
|
|
return TypeForwardSource
|
|
}
|
|
|
|
func (forwardSource *ForwardSource) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
ChatId int64 `json:"chat_id"`
|
|
MessageId int64 `json:"message_id"`
|
|
SenderId json.RawMessage `json:"sender_id"`
|
|
SenderName string `json:"sender_name"`
|
|
Date int32 `json:"date"`
|
|
IsOutgoing bool `json:"is_outgoing"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
forwardSource.ChatId = tmp.ChatId
|
|
forwardSource.MessageId = tmp.MessageId
|
|
forwardSource.SenderName = tmp.SenderName
|
|
forwardSource.Date = tmp.Date
|
|
forwardSource.IsOutgoing = tmp.IsOutgoing
|
|
|
|
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
|
|
forwardSource.SenderId = fieldSenderId
|
|
|
|
return nil
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// Contains information about a forwarded message
|
|
type MessageForwardInfo struct {
|
|
meta
|
|
// Origin of the forwarded message
|
|
Origin MessageOrigin `json:"origin"`
|
|
// Point in time (Unix timestamp) when the message was originally sent
|
|
Date int32 `json:"date"`
|
|
// For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, information about the source message from which the message was forwarded last time; may be null for other forwards or if unknown
|
|
Source *ForwardSource `json:"source"`
|
|
// The type of a public service announcement for the forwarded message
|
|
PublicServiceAnnouncementType string `json:"public_service_announcement_type"`
|
|
}
|
|
|
|
func (entity *MessageForwardInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageForwardInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageForwardInfo) GetClass() string {
|
|
return ClassMessageForwardInfo
|
|
}
|
|
|
|
func (*MessageForwardInfo) GetType() string {
|
|
return TypeMessageForwardInfo
|
|
}
|
|
|
|
func (messageForwardInfo *MessageForwardInfo) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Origin json.RawMessage `json:"origin"`
|
|
Date int32 `json:"date"`
|
|
Source *ForwardSource `json:"source"`
|
|
PublicServiceAnnouncementType string `json:"public_service_announcement_type"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
messageForwardInfo.Date = tmp.Date
|
|
messageForwardInfo.Source = tmp.Source
|
|
messageForwardInfo.PublicServiceAnnouncementType = tmp.PublicServiceAnnouncementType
|
|
|
|
fieldOrigin, _ := UnmarshalMessageOrigin(tmp.Origin)
|
|
messageForwardInfo.Origin = fieldOrigin
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains information about a message created with importMessages
|
|
type MessageImportInfo struct {
|
|
meta
|
|
// Name of the original sender
|
|
SenderName string `json:"sender_name"`
|
|
// Point in time (Unix timestamp) when the message was originally sent
|
|
Date int32 `json:"date"`
|
|
}
|
|
|
|
func (entity *MessageImportInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageImportInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageImportInfo) GetClass() string {
|
|
return ClassMessageImportInfo
|
|
}
|
|
|
|
func (*MessageImportInfo) GetType() string {
|
|
return TypeMessageImportInfo
|
|
}
|
|
|
|
// Contains information about replies to a message
|
|
type MessageReplyInfo struct {
|
|
meta
|
|
// Number of times the message was directly or indirectly replied
|
|
ReplyCount int32 `json:"reply_count"`
|
|
// 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
|
|
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"`
|
|
}
|
|
|
|
func (entity *MessageReplyInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageReplyInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageReplyInfo) GetClass() string {
|
|
return ClassMessageReplyInfo
|
|
}
|
|
|
|
func (*MessageReplyInfo) GetType() string {
|
|
return TypeMessageReplyInfo
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// 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"`
|
|
// Identifier of the message sender used by the current user to add the reaction; may be null if unknown or the reaction isn't chosen
|
|
UsedSenderId MessageSender `json:"used_sender_id"`
|
|
// 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"`
|
|
UsedSenderId json.RawMessage `json:"used_sender_id"`
|
|
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
|
|
|
|
fieldUsedSenderId, _ := UnmarshalMessageSender(tmp.UsedSenderId)
|
|
messageReaction.UsedSenderId = fieldUsedSenderId
|
|
|
|
fieldRecentSenderIds, _ := UnmarshalListOfMessageSender(tmp.RecentSenderIds)
|
|
messageReaction.RecentSenderIds = fieldRecentSenderIds
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains a list of reactions added to a message
|
|
type MessageReactions struct {
|
|
meta
|
|
// List of added reactions
|
|
Reactions []*MessageReaction `json:"reactions"`
|
|
// True, if the reactions are tags and Telegram Premium users can filter messages by them
|
|
AreTags bool `json:"are_tags"`
|
|
}
|
|
|
|
func (entity *MessageReactions) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageReactions
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageReactions) GetClass() string {
|
|
return ClassMessageReactions
|
|
}
|
|
|
|
func (*MessageReactions) GetType() string {
|
|
return TypeMessageReactions
|
|
}
|
|
|
|
// Contains information about interactions with a message
|
|
type MessageInteractionInfo struct {
|
|
meta
|
|
// 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"`
|
|
// The list of reactions or tags added to the message; may be null
|
|
Reactions *MessageReactions `json:"reactions"`
|
|
}
|
|
|
|
func (entity *MessageInteractionInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageInteractionInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageInteractionInfo) GetClass() string {
|
|
return ClassMessageInteractionInfo
|
|
}
|
|
|
|
func (*MessageInteractionInfo) GetType() string {
|
|
return TypeMessageInteractionInfo
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// The message is being sent now, but has not yet been delivered to the server
|
|
type MessageSendingStatePending struct {
|
|
meta
|
|
// Non-persistent message sending identifier, specified by the application
|
|
SendingId int32 `json:"sending_id"`
|
|
}
|
|
|
|
func (entity *MessageSendingStatePending) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSendingStatePending
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSendingStatePending) GetClass() string {
|
|
return ClassMessageSendingState
|
|
}
|
|
|
|
func (*MessageSendingStatePending) GetType() string {
|
|
return TypeMessageSendingStatePending
|
|
}
|
|
|
|
func (*MessageSendingStatePending) MessageSendingStateType() string {
|
|
return TypeMessageSendingStatePending
|
|
}
|
|
|
|
// The message failed to be sent
|
|
type MessageSendingStateFailed struct {
|
|
meta
|
|
// The cause of the message sending failure
|
|
Error *Error `json:"error"`
|
|
// 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"`
|
|
// True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message
|
|
NeedAnotherReplyQuote bool `json:"need_another_reply_quote"`
|
|
// True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages
|
|
NeedDropReply bool `json:"need_drop_reply"`
|
|
// Time left before the message can be re-sent, in seconds. No update is sent when this field changes
|
|
RetryAfter float64 `json:"retry_after"`
|
|
}
|
|
|
|
func (entity *MessageSendingStateFailed) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSendingStateFailed
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSendingStateFailed) GetClass() string {
|
|
return ClassMessageSendingState
|
|
}
|
|
|
|
func (*MessageSendingStateFailed) GetType() string {
|
|
return TypeMessageSendingStateFailed
|
|
}
|
|
|
|
func (*MessageSendingStateFailed) MessageSendingStateType() string {
|
|
return TypeMessageSendingStateFailed
|
|
}
|
|
|
|
// Describes manually or automatically chosen quote from another message
|
|
type TextQuote struct {
|
|
meta
|
|
// Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text
|
|
Text *FormattedText `json:"text"`
|
|
// Approximate quote position in the original message in UTF-16 code units as specified by the message sender
|
|
Position int32 `json:"position"`
|
|
// True, if the quote was manually chosen by the message sender
|
|
IsManual bool `json:"is_manual"`
|
|
}
|
|
|
|
func (entity *TextQuote) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub TextQuote
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*TextQuote) GetClass() string {
|
|
return ClassTextQuote
|
|
}
|
|
|
|
func (*TextQuote) GetType() string {
|
|
return TypeTextQuote
|
|
}
|
|
|
|
// Describes manually chosen quote from another message
|
|
type InputTextQuote struct {
|
|
meta
|
|
// Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote
|
|
Text *FormattedText `json:"text"`
|
|
// Quote position in the original message in UTF-16 code units
|
|
Position int32 `json:"position"`
|
|
}
|
|
|
|
func (entity *InputTextQuote) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputTextQuote
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputTextQuote) GetClass() string {
|
|
return ClassInputTextQuote
|
|
}
|
|
|
|
func (*InputTextQuote) GetType() string {
|
|
return TypeInputTextQuote
|
|
}
|
|
|
|
// Describes a message replied by a given message
|
|
type MessageReplyToMessage struct {
|
|
meta
|
|
// The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat
|
|
ChatId int64 `json:"chat_id"`
|
|
// The identifier of the message; may be 0 if the replied message is in unknown chat
|
|
MessageId int64 `json:"message_id"`
|
|
// Chosen quote from the replied message; may be null if none
|
|
Quote *TextQuote `json:"quote"`
|
|
// Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat
|
|
Origin MessageOrigin `json:"origin"`
|
|
// Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat
|
|
OriginSendDate int32 `json:"origin_send_date"`
|
|
// Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, messagePhoto, messagePoll, messagePremiumGiveaway, messagePremiumGiveawayWinners, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote
|
|
Content MessageContent `json:"content"`
|
|
}
|
|
|
|
func (entity *MessageReplyToMessage) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageReplyToMessage
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageReplyToMessage) GetClass() string {
|
|
return ClassMessageReplyTo
|
|
}
|
|
|
|
func (*MessageReplyToMessage) GetType() string {
|
|
return TypeMessageReplyToMessage
|
|
}
|
|
|
|
func (*MessageReplyToMessage) MessageReplyToType() string {
|
|
return TypeMessageReplyToMessage
|
|
}
|
|
|
|
func (messageReplyToMessage *MessageReplyToMessage) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
ChatId int64 `json:"chat_id"`
|
|
MessageId int64 `json:"message_id"`
|
|
Quote *TextQuote `json:"quote"`
|
|
Origin json.RawMessage `json:"origin"`
|
|
OriginSendDate int32 `json:"origin_send_date"`
|
|
Content json.RawMessage `json:"content"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
messageReplyToMessage.ChatId = tmp.ChatId
|
|
messageReplyToMessage.MessageId = tmp.MessageId
|
|
messageReplyToMessage.Quote = tmp.Quote
|
|
messageReplyToMessage.OriginSendDate = tmp.OriginSendDate
|
|
|
|
fieldOrigin, _ := UnmarshalMessageOrigin(tmp.Origin)
|
|
messageReplyToMessage.Origin = fieldOrigin
|
|
|
|
fieldContent, _ := UnmarshalMessageContent(tmp.Content)
|
|
messageReplyToMessage.Content = fieldContent
|
|
|
|
return nil
|
|
}
|
|
|
|
// Describes a story replied by a given message
|
|
type MessageReplyToStory struct {
|
|
meta
|
|
// The identifier of the sender of the story
|
|
StorySenderChatId int64 `json:"story_sender_chat_id"`
|
|
// The identifier of the story
|
|
StoryId int32 `json:"story_id"`
|
|
}
|
|
|
|
func (entity *MessageReplyToStory) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageReplyToStory
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageReplyToStory) GetClass() string {
|
|
return ClassMessageReplyTo
|
|
}
|
|
|
|
func (*MessageReplyToStory) GetType() string {
|
|
return TypeMessageReplyToStory
|
|
}
|
|
|
|
func (*MessageReplyToStory) MessageReplyToType() string {
|
|
return TypeMessageReplyToStory
|
|
}
|
|
|
|
// Describes a message to be replied
|
|
type InputMessageReplyToMessage struct {
|
|
meta
|
|
// The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat or topic only if message.can_be_replied_in_another_chat
|
|
ChatId int64 `json:"chat_id"`
|
|
// The identifier of the message to be replied in the same or the specified chat
|
|
MessageId int64 `json:"message_id"`
|
|
// Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats
|
|
Quote *InputTextQuote `json:"quote"`
|
|
}
|
|
|
|
func (entity *InputMessageReplyToMessage) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputMessageReplyToMessage
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputMessageReplyToMessage) GetClass() string {
|
|
return ClassInputMessageReplyTo
|
|
}
|
|
|
|
func (*InputMessageReplyToMessage) GetType() string {
|
|
return TypeInputMessageReplyToMessage
|
|
}
|
|
|
|
func (*InputMessageReplyToMessage) InputMessageReplyToType() string {
|
|
return TypeInputMessageReplyToMessage
|
|
}
|
|
|
|
// Describes a story to be replied
|
|
type InputMessageReplyToStory struct {
|
|
meta
|
|
// The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat and channel stories can't be replied
|
|
StorySenderChatId int64 `json:"story_sender_chat_id"`
|
|
// The identifier of the story
|
|
StoryId int32 `json:"story_id"`
|
|
}
|
|
|
|
func (entity *InputMessageReplyToStory) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputMessageReplyToStory
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputMessageReplyToStory) GetClass() string {
|
|
return ClassInputMessageReplyTo
|
|
}
|
|
|
|
func (*InputMessageReplyToStory) GetType() string {
|
|
return TypeInputMessageReplyToStory
|
|
}
|
|
|
|
func (*InputMessageReplyToStory) InputMessageReplyToType() string {
|
|
return TypeInputMessageReplyToStory
|
|
}
|
|
|
|
// Describes a message
|
|
type Message struct {
|
|
meta
|
|
// 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 if the message isn't being sent and didn't fail to be sent
|
|
SendingState MessageSendingState `json:"sending_state"`
|
|
// The scheduling state of the message; may be null if the message isn't scheduled
|
|
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 was sent because of a scheduled action by the message sender, for example, as away, or greeting service message
|
|
IsFromOffline bool `json:"is_from_offline"`
|
|
// 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 the message can be replied in another chat or topic
|
|
CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"`
|
|
// 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"`
|
|
// 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
|
|
CanGetStatistics bool `json:"can_get_statistics"`
|
|
// True, if information about the message thread is available through getMessageThread and getMessageThreadHistory
|
|
CanGetMessageThread bool `json:"can_get_message_thread"`
|
|
// True, if read date of the message can be received through getMessageReadDate
|
|
CanGetReadDate bool `json:"can_get_read_date"`
|
|
// True, if chat members already viewed the message can be received through getMessageViewers
|
|
CanGetViewers bool `json:"can_get_viewers"`
|
|
// True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink
|
|
CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"`
|
|
// True, if reactions on the message can be reported through reportMessageReactions
|
|
CanReportReactions bool `json:"can_report_reactions"`
|
|
// 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"`
|
|
// True, if the message is a forum topic message
|
|
IsTopicMessage bool `json:"is_topic_message"`
|
|
// True, if the message contains an unread mention for the current user
|
|
ContainsUnreadMention bool `json:"contains_unread_mention"`
|
|
// Point in time (Unix timestamp) when the message was sent
|
|
Date int32 `json:"date"`
|
|
// 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 if none or unknown
|
|
ForwardInfo *MessageForwardInfo `json:"forward_info"`
|
|
// Information about the initial message for messages created with importMessages; may be null if the message isn't imported
|
|
ImportInfo *MessageImportInfo `json:"import_info"`
|
|
// Information about interactions with the message; may be null if none
|
|
InteractionInfo *MessageInteractionInfo `json:"interaction_info"`
|
|
// Information about unread reactions added to the message
|
|
UnreadReactions []*UnreadReaction `json:"unread_reactions"`
|
|
// Information about the message or the story this message is replying to; may be null if none
|
|
ReplyTo MessageReplyTo `json:"reply_to"`
|
|
// 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"`
|
|
// Identifier of the Saved Messages topic for the message; 0 for messages not from Saved Messages
|
|
SavedMessagesTopicId int64 `json:"saved_messages_topic_id"`
|
|
// The message's self-destruct type; may be null if none
|
|
SelfDestructType MessageSelfDestructType `json:"self_destruct_type"`
|
|
// Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet
|
|
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
|
|
AutoDeleteIn float64 `json:"auto_delete_in"`
|
|
// If non-zero, the user identifier of the inline bot through which this message was sent
|
|
ViaBotUserId int64 `json:"via_bot_user_id"`
|
|
// If non-zero, the user identifier of the business bot that sent this message
|
|
SenderBusinessBotUserId int64 `json:"sender_business_bot_user_id"`
|
|
// Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead
|
|
SenderBoostCount int32 `json:"sender_boost_count"`
|
|
// 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 if none
|
|
ReplyMarkup ReplyMarkup `json:"reply_markup"`
|
|
}
|
|
|
|
func (entity *Message) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub Message
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*Message) GetClass() string {
|
|
return ClassMessage
|
|
}
|
|
|
|
func (*Message) GetType() string {
|
|
return TypeMessage
|
|
}
|
|
|
|
func (message *Message) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
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"`
|
|
IsFromOffline bool `json:"is_from_offline"`
|
|
CanBeEdited bool `json:"can_be_edited"`
|
|
CanBeForwarded bool `json:"can_be_forwarded"`
|
|
CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"`
|
|
CanBeSaved bool `json:"can_be_saved"`
|
|
CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"`
|
|
CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"`
|
|
CanGetAddedReactions bool `json:"can_get_added_reactions"`
|
|
CanGetStatistics bool `json:"can_get_statistics"`
|
|
CanGetMessageThread bool `json:"can_get_message_thread"`
|
|
CanGetReadDate bool `json:"can_get_read_date"`
|
|
CanGetViewers bool `json:"can_get_viewers"`
|
|
CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"`
|
|
CanReportReactions bool `json:"can_report_reactions"`
|
|
HasTimestampedMedia bool `json:"has_timestamped_media"`
|
|
IsChannelPost bool `json:"is_channel_post"`
|
|
IsTopicMessage bool `json:"is_topic_message"`
|
|
ContainsUnreadMention bool `json:"contains_unread_mention"`
|
|
Date int32 `json:"date"`
|
|
EditDate int32 `json:"edit_date"`
|
|
ForwardInfo *MessageForwardInfo `json:"forward_info"`
|
|
ImportInfo *MessageImportInfo `json:"import_info"`
|
|
InteractionInfo *MessageInteractionInfo `json:"interaction_info"`
|
|
UnreadReactions []*UnreadReaction `json:"unread_reactions"`
|
|
ReplyTo json.RawMessage `json:"reply_to"`
|
|
MessageThreadId int64 `json:"message_thread_id"`
|
|
SavedMessagesTopicId int64 `json:"saved_messages_topic_id"`
|
|
SelfDestructType json.RawMessage `json:"self_destruct_type"`
|
|
SelfDestructIn float64 `json:"self_destruct_in"`
|
|
AutoDeleteIn float64 `json:"auto_delete_in"`
|
|
ViaBotUserId int64 `json:"via_bot_user_id"`
|
|
SenderBusinessBotUserId int64 `json:"sender_business_bot_user_id"`
|
|
SenderBoostCount int32 `json:"sender_boost_count"`
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
message.Id = tmp.Id
|
|
message.ChatId = tmp.ChatId
|
|
message.IsOutgoing = tmp.IsOutgoing
|
|
message.IsPinned = tmp.IsPinned
|
|
message.IsFromOffline = tmp.IsFromOffline
|
|
message.CanBeEdited = tmp.CanBeEdited
|
|
message.CanBeForwarded = tmp.CanBeForwarded
|
|
message.CanBeRepliedInAnotherChat = tmp.CanBeRepliedInAnotherChat
|
|
message.CanBeSaved = tmp.CanBeSaved
|
|
message.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf
|
|
message.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers
|
|
message.CanGetAddedReactions = tmp.CanGetAddedReactions
|
|
message.CanGetStatistics = tmp.CanGetStatistics
|
|
message.CanGetMessageThread = tmp.CanGetMessageThread
|
|
message.CanGetReadDate = tmp.CanGetReadDate
|
|
message.CanGetViewers = tmp.CanGetViewers
|
|
message.CanGetMediaTimestampLinks = tmp.CanGetMediaTimestampLinks
|
|
message.CanReportReactions = tmp.CanReportReactions
|
|
message.HasTimestampedMedia = tmp.HasTimestampedMedia
|
|
message.IsChannelPost = tmp.IsChannelPost
|
|
message.IsTopicMessage = tmp.IsTopicMessage
|
|
message.ContainsUnreadMention = tmp.ContainsUnreadMention
|
|
message.Date = tmp.Date
|
|
message.EditDate = tmp.EditDate
|
|
message.ForwardInfo = tmp.ForwardInfo
|
|
message.ImportInfo = tmp.ImportInfo
|
|
message.InteractionInfo = tmp.InteractionInfo
|
|
message.UnreadReactions = tmp.UnreadReactions
|
|
message.MessageThreadId = tmp.MessageThreadId
|
|
message.SavedMessagesTopicId = tmp.SavedMessagesTopicId
|
|
message.SelfDestructIn = tmp.SelfDestructIn
|
|
message.AutoDeleteIn = tmp.AutoDeleteIn
|
|
message.ViaBotUserId = tmp.ViaBotUserId
|
|
message.SenderBusinessBotUserId = tmp.SenderBusinessBotUserId
|
|
message.SenderBoostCount = tmp.SenderBoostCount
|
|
message.AuthorSignature = tmp.AuthorSignature
|
|
message.MediaAlbumId = tmp.MediaAlbumId
|
|
message.RestrictionReason = tmp.RestrictionReason
|
|
|
|
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
|
|
message.SenderId = fieldSenderId
|
|
|
|
fieldSendingState, _ := UnmarshalMessageSendingState(tmp.SendingState)
|
|
message.SendingState = fieldSendingState
|
|
|
|
fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState)
|
|
message.SchedulingState = fieldSchedulingState
|
|
|
|
fieldReplyTo, _ := UnmarshalMessageReplyTo(tmp.ReplyTo)
|
|
message.ReplyTo = fieldReplyTo
|
|
|
|
fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType)
|
|
message.SelfDestructType = fieldSelfDestructType
|
|
|
|
fieldContent, _ := UnmarshalMessageContent(tmp.Content)
|
|
message.Content = fieldContent
|
|
|
|
fieldReplyMarkup, _ := UnmarshalReplyMarkup(tmp.ReplyMarkup)
|
|
message.ReplyMarkup = fieldReplyMarkup
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains a list of messages
|
|
type Messages struct {
|
|
meta
|
|
// Approximate total number of messages found
|
|
TotalCount int32 `json:"total_count"`
|
|
// List of messages; messages may be null
|
|
Messages []*Message `json:"messages"`
|
|
}
|
|
|
|
func (entity *Messages) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub Messages
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*Messages) GetClass() string {
|
|
return ClassMessages
|
|
}
|
|
|
|
func (*Messages) GetType() string {
|
|
return TypeMessages
|
|
}
|
|
|
|
// Contains a list of messages found by a search
|
|
type FoundMessages 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 empty, then there are no more results
|
|
NextOffset string `json:"next_offset"`
|
|
}
|
|
|
|
func (entity *FoundMessages) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub FoundMessages
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*FoundMessages) GetClass() string {
|
|
return ClassFoundMessages
|
|
}
|
|
|
|
func (*FoundMessages) GetType() string {
|
|
return TypeFoundMessages
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// Contains information about a message in a specific position
|
|
type MessagePosition struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *MessagePosition) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessagePosition
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessagePosition) GetClass() string {
|
|
return ClassMessagePosition
|
|
}
|
|
|
|
func (*MessagePosition) GetType() string {
|
|
return TypeMessagePosition
|
|
}
|
|
|
|
// Contains a list of message positions
|
|
type MessagePositions struct {
|
|
meta
|
|
// Total number of messages found
|
|
TotalCount int32 `json:"total_count"`
|
|
// List of message positions
|
|
Positions []*MessagePosition `json:"positions"`
|
|
}
|
|
|
|
func (entity *MessagePositions) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessagePositions
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessagePositions) GetClass() string {
|
|
return ClassMessagePositions
|
|
}
|
|
|
|
func (*MessagePositions) GetType() string {
|
|
return TypeMessagePositions
|
|
}
|
|
|
|
// Contains information about found messages sent on a specific day
|
|
type MessageCalendarDay struct {
|
|
meta
|
|
// Total number of found messages sent on the day
|
|
TotalCount int32 `json:"total_count"`
|
|
// First message sent on the day
|
|
Message *Message `json:"message"`
|
|
}
|
|
|
|
func (entity *MessageCalendarDay) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageCalendarDay
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageCalendarDay) GetClass() string {
|
|
return ClassMessageCalendarDay
|
|
}
|
|
|
|
func (*MessageCalendarDay) GetType() string {
|
|
return TypeMessageCalendarDay
|
|
}
|
|
|
|
// Contains information about found messages, split by days according to the option "utc_time_offset"
|
|
type MessageCalendar struct {
|
|
meta
|
|
// Total number of found messages
|
|
TotalCount int32 `json:"total_count"`
|
|
// Information about messages sent
|
|
Days []*MessageCalendarDay `json:"days"`
|
|
}
|
|
|
|
func (entity *MessageCalendar) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageCalendar
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageCalendar) GetClass() string {
|
|
return ClassMessageCalendar
|
|
}
|
|
|
|
func (*MessageCalendar) GetType() string {
|
|
return TypeMessageCalendar
|
|
}
|
|
|
|
// Describes a message from a business account as received by a bot
|
|
type BusinessMessage struct {
|
|
meta
|
|
// The message
|
|
Message *Message `json:"message"`
|
|
// Message that is replied by the message in the same chat; may be null if none
|
|
ReplyToMessage *Message `json:"reply_to_message"`
|
|
}
|
|
|
|
func (entity *BusinessMessage) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessMessage
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessMessage) GetClass() string {
|
|
return ClassBusinessMessage
|
|
}
|
|
|
|
func (*BusinessMessage) GetType() string {
|
|
return TypeBusinessMessage
|
|
}
|
|
|
|
// Contains a list of messages from a business account as received by a bot
|
|
type BusinessMessages struct {
|
|
meta
|
|
// List of business messages
|
|
Messages []*BusinessMessage `json:"messages"`
|
|
}
|
|
|
|
func (entity *BusinessMessages) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BusinessMessages
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BusinessMessages) GetClass() string {
|
|
return ClassBusinessMessages
|
|
}
|
|
|
|
func (*BusinessMessages) GetType() string {
|
|
return TypeBusinessMessages
|
|
}
|
|
|
|
// The message is from a chat history
|
|
type MessageSourceChatHistory struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageSourceChatHistory) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSourceChatHistory
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSourceChatHistory) GetClass() string {
|
|
return ClassMessageSource
|
|
}
|
|
|
|
func (*MessageSourceChatHistory) GetType() string {
|
|
return TypeMessageSourceChatHistory
|
|
}
|
|
|
|
func (*MessageSourceChatHistory) MessageSourceType() string {
|
|
return TypeMessageSourceChatHistory
|
|
}
|
|
|
|
// The message is from a message thread history
|
|
type MessageSourceMessageThreadHistory struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageSourceMessageThreadHistory) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSourceMessageThreadHistory
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSourceMessageThreadHistory) GetClass() string {
|
|
return ClassMessageSource
|
|
}
|
|
|
|
func (*MessageSourceMessageThreadHistory) GetType() string {
|
|
return TypeMessageSourceMessageThreadHistory
|
|
}
|
|
|
|
func (*MessageSourceMessageThreadHistory) MessageSourceType() string {
|
|
return TypeMessageSourceMessageThreadHistory
|
|
}
|
|
|
|
// The message is from a forum topic history
|
|
type MessageSourceForumTopicHistory struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageSourceForumTopicHistory) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSourceForumTopicHistory
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSourceForumTopicHistory) GetClass() string {
|
|
return ClassMessageSource
|
|
}
|
|
|
|
func (*MessageSourceForumTopicHistory) GetType() string {
|
|
return TypeMessageSourceForumTopicHistory
|
|
}
|
|
|
|
func (*MessageSourceForumTopicHistory) MessageSourceType() string {
|
|
return TypeMessageSourceForumTopicHistory
|
|
}
|
|
|
|
// The message is from chat, message thread or forum topic history preview
|
|
type MessageSourceHistoryPreview struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageSourceHistoryPreview) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSourceHistoryPreview
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSourceHistoryPreview) GetClass() string {
|
|
return ClassMessageSource
|
|
}
|
|
|
|
func (*MessageSourceHistoryPreview) GetType() string {
|
|
return TypeMessageSourceHistoryPreview
|
|
}
|
|
|
|
func (*MessageSourceHistoryPreview) MessageSourceType() string {
|
|
return TypeMessageSourceHistoryPreview
|
|
}
|
|
|
|
// The message is from a chat list or a forum topic list
|
|
type MessageSourceChatList struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageSourceChatList) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSourceChatList
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSourceChatList) GetClass() string {
|
|
return ClassMessageSource
|
|
}
|
|
|
|
func (*MessageSourceChatList) GetType() string {
|
|
return TypeMessageSourceChatList
|
|
}
|
|
|
|
func (*MessageSourceChatList) MessageSourceType() string {
|
|
return TypeMessageSourceChatList
|
|
}
|
|
|
|
// The message is from search results, including file downloads, local file list, outgoing document messages, calendar
|
|
type MessageSourceSearch struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageSourceSearch) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSourceSearch
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSourceSearch) GetClass() string {
|
|
return ClassMessageSource
|
|
}
|
|
|
|
func (*MessageSourceSearch) GetType() string {
|
|
return TypeMessageSourceSearch
|
|
}
|
|
|
|
func (*MessageSourceSearch) MessageSourceType() string {
|
|
return TypeMessageSourceSearch
|
|
}
|
|
|
|
// The message is from a chat event log
|
|
type MessageSourceChatEventLog struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageSourceChatEventLog) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSourceChatEventLog
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSourceChatEventLog) GetClass() string {
|
|
return ClassMessageSource
|
|
}
|
|
|
|
func (*MessageSourceChatEventLog) GetType() string {
|
|
return TypeMessageSourceChatEventLog
|
|
}
|
|
|
|
func (*MessageSourceChatEventLog) MessageSourceType() string {
|
|
return TypeMessageSourceChatEventLog
|
|
}
|
|
|
|
// The message is from a notification
|
|
type MessageSourceNotification struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageSourceNotification) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSourceNotification
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSourceNotification) GetClass() string {
|
|
return ClassMessageSource
|
|
}
|
|
|
|
func (*MessageSourceNotification) GetType() string {
|
|
return TypeMessageSourceNotification
|
|
}
|
|
|
|
func (*MessageSourceNotification) MessageSourceType() string {
|
|
return TypeMessageSourceNotification
|
|
}
|
|
|
|
// The message was screenshotted; the source must be used only if the message content was visible during the screenshot
|
|
type MessageSourceScreenshot struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageSourceScreenshot) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSourceScreenshot
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSourceScreenshot) GetClass() string {
|
|
return ClassMessageSource
|
|
}
|
|
|
|
func (*MessageSourceScreenshot) GetType() string {
|
|
return TypeMessageSourceScreenshot
|
|
}
|
|
|
|
func (*MessageSourceScreenshot) MessageSourceType() string {
|
|
return TypeMessageSourceScreenshot
|
|
}
|
|
|
|
// The message is from some other source
|
|
type MessageSourceOther struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *MessageSourceOther) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSourceOther
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSourceOther) GetClass() string {
|
|
return ClassMessageSource
|
|
}
|
|
|
|
func (*MessageSourceOther) GetType() string {
|
|
return TypeMessageSourceOther
|
|
}
|
|
|
|
func (*MessageSourceOther) MessageSourceType() string {
|
|
return TypeMessageSourceOther
|
|
}
|
|
|
|
// The sponsor is a bot
|
|
type MessageSponsorTypeBot struct {
|
|
meta
|
|
// User identifier of the bot
|
|
BotUserId int64 `json:"bot_user_id"`
|
|
// An internal link to be opened when the sponsored message is clicked
|
|
Link InternalLinkType `json:"link"`
|
|
}
|
|
|
|
func (entity *MessageSponsorTypeBot) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSponsorTypeBot
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSponsorTypeBot) GetClass() string {
|
|
return ClassMessageSponsorType
|
|
}
|
|
|
|
func (*MessageSponsorTypeBot) GetType() string {
|
|
return TypeMessageSponsorTypeBot
|
|
}
|
|
|
|
func (*MessageSponsorTypeBot) MessageSponsorTypeType() string {
|
|
return TypeMessageSponsorTypeBot
|
|
}
|
|
|
|
func (messageSponsorTypeBot *MessageSponsorTypeBot) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
BotUserId int64 `json:"bot_user_id"`
|
|
Link json.RawMessage `json:"link"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
messageSponsorTypeBot.BotUserId = tmp.BotUserId
|
|
|
|
fieldLink, _ := UnmarshalInternalLinkType(tmp.Link)
|
|
messageSponsorTypeBot.Link = fieldLink
|
|
|
|
return nil
|
|
}
|
|
|
|
// The sponsor is a web app
|
|
type MessageSponsorTypeWebApp struct {
|
|
meta
|
|
// Web App title
|
|
WebAppTitle string `json:"web_app_title"`
|
|
// An internal link to be opened when the sponsored message is clicked
|
|
Link InternalLinkType `json:"link"`
|
|
}
|
|
|
|
func (entity *MessageSponsorTypeWebApp) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSponsorTypeWebApp
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSponsorTypeWebApp) GetClass() string {
|
|
return ClassMessageSponsorType
|
|
}
|
|
|
|
func (*MessageSponsorTypeWebApp) GetType() string {
|
|
return TypeMessageSponsorTypeWebApp
|
|
}
|
|
|
|
func (*MessageSponsorTypeWebApp) MessageSponsorTypeType() string {
|
|
return TypeMessageSponsorTypeWebApp
|
|
}
|
|
|
|
func (messageSponsorTypeWebApp *MessageSponsorTypeWebApp) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
WebAppTitle string `json:"web_app_title"`
|
|
Link json.RawMessage `json:"link"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
messageSponsorTypeWebApp.WebAppTitle = tmp.WebAppTitle
|
|
|
|
fieldLink, _ := UnmarshalInternalLinkType(tmp.Link)
|
|
messageSponsorTypeWebApp.Link = fieldLink
|
|
|
|
return nil
|
|
}
|
|
|
|
// The sponsor is a public channel chat
|
|
type MessageSponsorTypePublicChannel struct {
|
|
meta
|
|
// Sponsor chat identifier
|
|
ChatId int64 `json:"chat_id"`
|
|
// An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead
|
|
Link InternalLinkType `json:"link"`
|
|
}
|
|
|
|
func (entity *MessageSponsorTypePublicChannel) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSponsorTypePublicChannel
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSponsorTypePublicChannel) GetClass() string {
|
|
return ClassMessageSponsorType
|
|
}
|
|
|
|
func (*MessageSponsorTypePublicChannel) GetType() string {
|
|
return TypeMessageSponsorTypePublicChannel
|
|
}
|
|
|
|
func (*MessageSponsorTypePublicChannel) MessageSponsorTypeType() string {
|
|
return TypeMessageSponsorTypePublicChannel
|
|
}
|
|
|
|
func (messageSponsorTypePublicChannel *MessageSponsorTypePublicChannel) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
ChatId int64 `json:"chat_id"`
|
|
Link json.RawMessage `json:"link"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
messageSponsorTypePublicChannel.ChatId = tmp.ChatId
|
|
|
|
fieldLink, _ := UnmarshalInternalLinkType(tmp.Link)
|
|
messageSponsorTypePublicChannel.Link = fieldLink
|
|
|
|
return nil
|
|
}
|
|
|
|
// The sponsor is a private channel chat
|
|
type MessageSponsorTypePrivateChannel struct {
|
|
meta
|
|
// Title of the chat
|
|
Title string `json:"title"`
|
|
// Invite link for the channel
|
|
InviteLink string `json:"invite_link"`
|
|
}
|
|
|
|
func (entity *MessageSponsorTypePrivateChannel) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSponsorTypePrivateChannel
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSponsorTypePrivateChannel) GetClass() string {
|
|
return ClassMessageSponsorType
|
|
}
|
|
|
|
func (*MessageSponsorTypePrivateChannel) GetType() string {
|
|
return TypeMessageSponsorTypePrivateChannel
|
|
}
|
|
|
|
func (*MessageSponsorTypePrivateChannel) MessageSponsorTypeType() string {
|
|
return TypeMessageSponsorTypePrivateChannel
|
|
}
|
|
|
|
// The sponsor is a website
|
|
type MessageSponsorTypeWebsite struct {
|
|
meta
|
|
// URL of the website
|
|
Url string `json:"url"`
|
|
// Name of the website
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
func (entity *MessageSponsorTypeWebsite) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSponsorTypeWebsite
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSponsorTypeWebsite) GetClass() string {
|
|
return ClassMessageSponsorType
|
|
}
|
|
|
|
func (*MessageSponsorTypeWebsite) GetType() string {
|
|
return TypeMessageSponsorTypeWebsite
|
|
}
|
|
|
|
func (*MessageSponsorTypeWebsite) MessageSponsorTypeType() string {
|
|
return TypeMessageSponsorTypeWebsite
|
|
}
|
|
|
|
// Information about the sponsor of a message
|
|
type MessageSponsor struct {
|
|
meta
|
|
// Type of the sponsor
|
|
Type MessageSponsorType `json:"type"`
|
|
// Photo of the sponsor; may be null if must not be shown
|
|
Photo *ChatPhotoInfo `json:"photo"`
|
|
// Additional optional information about the sponsor to be shown along with the message
|
|
Info string `json:"info"`
|
|
}
|
|
|
|
func (entity *MessageSponsor) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageSponsor
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageSponsor) GetClass() string {
|
|
return ClassMessageSponsor
|
|
}
|
|
|
|
func (*MessageSponsor) GetType() string {
|
|
return TypeMessageSponsor
|
|
}
|
|
|
|
func (messageSponsor *MessageSponsor) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Type json.RawMessage `json:"type"`
|
|
Photo *ChatPhotoInfo `json:"photo"`
|
|
Info string `json:"info"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
messageSponsor.Photo = tmp.Photo
|
|
messageSponsor.Info = tmp.Info
|
|
|
|
fieldType, _ := UnmarshalMessageSponsorType(tmp.Type)
|
|
messageSponsor.Type = fieldType
|
|
|
|
return nil
|
|
}
|
|
|
|
// Describes a sponsored message
|
|
type SponsoredMessage struct {
|
|
meta
|
|
// Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages
|
|
MessageId int64 `json:"message_id"`
|
|
// True, if the message needs to be labeled as "recommended" instead of "sponsored"
|
|
IsRecommended bool `json:"is_recommended"`
|
|
// True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage
|
|
CanBeReported bool `json:"can_be_reported"`
|
|
// Content of the message. Currently, can be only of the type messageText
|
|
Content MessageContent `json:"content"`
|
|
// Information about the sponsor of the message
|
|
Sponsor *MessageSponsor `json:"sponsor"`
|
|
// If non-empty, text for the message action button
|
|
ButtonText string `json:"button_text"`
|
|
// If non-empty, additional information about the sponsored message to be shown along with the message
|
|
AdditionalInfo string `json:"additional_info"`
|
|
}
|
|
|
|
func (entity *SponsoredMessage) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SponsoredMessage
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SponsoredMessage) GetClass() string {
|
|
return ClassSponsoredMessage
|
|
}
|
|
|
|
func (*SponsoredMessage) GetType() string {
|
|
return TypeSponsoredMessage
|
|
}
|
|
|
|
func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
MessageId int64 `json:"message_id"`
|
|
IsRecommended bool `json:"is_recommended"`
|
|
CanBeReported bool `json:"can_be_reported"`
|
|
Content json.RawMessage `json:"content"`
|
|
Sponsor *MessageSponsor `json:"sponsor"`
|
|
ButtonText string `json:"button_text"`
|
|
AdditionalInfo string `json:"additional_info"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
sponsoredMessage.MessageId = tmp.MessageId
|
|
sponsoredMessage.IsRecommended = tmp.IsRecommended
|
|
sponsoredMessage.CanBeReported = tmp.CanBeReported
|
|
sponsoredMessage.Sponsor = tmp.Sponsor
|
|
sponsoredMessage.ButtonText = tmp.ButtonText
|
|
sponsoredMessage.AdditionalInfo = tmp.AdditionalInfo
|
|
|
|
fieldContent, _ := UnmarshalMessageContent(tmp.Content)
|
|
sponsoredMessage.Content = fieldContent
|
|
|
|
return nil
|
|
}
|
|
|
|
// 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 an option to report a sponsored message
|
|
type ReportChatSponsoredMessageOption struct {
|
|
meta
|
|
// Unique identifier of the option
|
|
Id []byte `json:"id"`
|
|
// Text of the option
|
|
Text string `json:"text"`
|
|
}
|
|
|
|
func (entity *ReportChatSponsoredMessageOption) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ReportChatSponsoredMessageOption
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageOption) GetClass() string {
|
|
return ClassReportChatSponsoredMessageOption
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageOption) GetType() string {
|
|
return TypeReportChatSponsoredMessageOption
|
|
}
|
|
|
|
// The message was reported successfully
|
|
type ReportChatSponsoredMessageResultOk struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ReportChatSponsoredMessageResultOk) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ReportChatSponsoredMessageResultOk
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultOk) GetClass() string {
|
|
return ClassReportChatSponsoredMessageResult
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultOk) GetType() string {
|
|
return TypeReportChatSponsoredMessageResultOk
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultOk) ReportChatSponsoredMessageResultType() string {
|
|
return TypeReportChatSponsoredMessageResultOk
|
|
}
|
|
|
|
// The sponsored message is too old or not found
|
|
type ReportChatSponsoredMessageResultFailed struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ReportChatSponsoredMessageResultFailed) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ReportChatSponsoredMessageResultFailed
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultFailed) GetClass() string {
|
|
return ClassReportChatSponsoredMessageResult
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultFailed) GetType() string {
|
|
return TypeReportChatSponsoredMessageResultFailed
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultFailed) ReportChatSponsoredMessageResultType() string {
|
|
return TypeReportChatSponsoredMessageResultFailed
|
|
}
|
|
|
|
// The user must choose an option to report the message and repeat request with the chosen option
|
|
type ReportChatSponsoredMessageResultOptionRequired struct {
|
|
meta
|
|
// Title for the option choice
|
|
Title string `json:"title"`
|
|
// List of available options
|
|
Options []*ReportChatSponsoredMessageOption `json:"options"`
|
|
}
|
|
|
|
func (entity *ReportChatSponsoredMessageResultOptionRequired) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ReportChatSponsoredMessageResultOptionRequired
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultOptionRequired) GetClass() string {
|
|
return ClassReportChatSponsoredMessageResult
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultOptionRequired) GetType() string {
|
|
return TypeReportChatSponsoredMessageResultOptionRequired
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultOptionRequired) ReportChatSponsoredMessageResultType() string {
|
|
return TypeReportChatSponsoredMessageResultOptionRequired
|
|
}
|
|
|
|
// Sponsored messages were hidden for the user in all chats
|
|
type ReportChatSponsoredMessageResultAdsHidden struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ReportChatSponsoredMessageResultAdsHidden) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ReportChatSponsoredMessageResultAdsHidden
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultAdsHidden) GetClass() string {
|
|
return ClassReportChatSponsoredMessageResult
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultAdsHidden) GetType() string {
|
|
return TypeReportChatSponsoredMessageResultAdsHidden
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultAdsHidden) ReportChatSponsoredMessageResultType() string {
|
|
return TypeReportChatSponsoredMessageResultAdsHidden
|
|
}
|
|
|
|
// The user asked to hide sponsored messages, but Telegram Premium is required for this
|
|
type ReportChatSponsoredMessageResultPremiumRequired struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ReportChatSponsoredMessageResultPremiumRequired) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ReportChatSponsoredMessageResultPremiumRequired
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultPremiumRequired) GetClass() string {
|
|
return ClassReportChatSponsoredMessageResult
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultPremiumRequired) GetType() string {
|
|
return TypeReportChatSponsoredMessageResultPremiumRequired
|
|
}
|
|
|
|
func (*ReportChatSponsoredMessageResultPremiumRequired) ReportChatSponsoredMessageResultType() string {
|
|
return TypeReportChatSponsoredMessageResultPremiumRequired
|
|
}
|
|
|
|
// 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, then 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
|
|
}
|
|
|
|
// Notification settings applied to all private and secret chats when the corresponding chat setting has a default value
|
|
type NotificationSettingsScopePrivateChats struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *NotificationSettingsScopePrivateChats) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub NotificationSettingsScopePrivateChats
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*NotificationSettingsScopePrivateChats) GetClass() string {
|
|
return ClassNotificationSettingsScope
|
|
}
|
|
|
|
func (*NotificationSettingsScopePrivateChats) GetType() string {
|
|
return TypeNotificationSettingsScopePrivateChats
|
|
}
|
|
|
|
func (*NotificationSettingsScopePrivateChats) NotificationSettingsScopeType() string {
|
|
return TypeNotificationSettingsScopePrivateChats
|
|
}
|
|
|
|
// Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value
|
|
type NotificationSettingsScopeGroupChats struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *NotificationSettingsScopeGroupChats) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub NotificationSettingsScopeGroupChats
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*NotificationSettingsScopeGroupChats) GetClass() string {
|
|
return ClassNotificationSettingsScope
|
|
}
|
|
|
|
func (*NotificationSettingsScopeGroupChats) GetType() string {
|
|
return TypeNotificationSettingsScopeGroupChats
|
|
}
|
|
|
|
func (*NotificationSettingsScopeGroupChats) NotificationSettingsScopeType() string {
|
|
return TypeNotificationSettingsScopeGroupChats
|
|
}
|
|
|
|
// Notification settings applied to all channel chats when the corresponding chat setting has a default value
|
|
type NotificationSettingsScopeChannelChats struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *NotificationSettingsScopeChannelChats) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub NotificationSettingsScopeChannelChats
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*NotificationSettingsScopeChannelChats) GetClass() string {
|
|
return ClassNotificationSettingsScope
|
|
}
|
|
|
|
func (*NotificationSettingsScopeChannelChats) GetType() string {
|
|
return TypeNotificationSettingsScopeChannelChats
|
|
}
|
|
|
|
func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() string {
|
|
return TypeNotificationSettingsScopeChannelChats
|
|
}
|
|
|
|
// Contains information about notification settings for a chat or a forum topic
|
|
type ChatNotificationSettings struct {
|
|
meta
|
|
// If true, the value for the relevant type of chat or the forum chat is used instead of mute_for
|
|
UseDefaultMuteFor bool `json:"use_default_mute_for"`
|
|
// Time left before notifications will be unmuted, in seconds
|
|
MuteFor int32 `json:"mute_for"`
|
|
// If true, the value for the relevant type of chat or the forum chat is used instead of sound_id
|
|
UseDefaultSound bool `json:"use_default_sound"`
|
|
// Identifier of the notification sound to be played for messages; 0 if sound is disabled
|
|
SoundId JsonInt64 `json:"sound_id"`
|
|
// If true, the value for the relevant type of chat or the forum chat is used instead of show_preview
|
|
UseDefaultShowPreview bool `json:"use_default_show_preview"`
|
|
// True, if message content must be displayed in notifications
|
|
ShowPreview bool `json:"show_preview"`
|
|
// If true, the value for the relevant type of chat is used instead of mute_stories
|
|
UseDefaultMuteStories bool `json:"use_default_mute_stories"`
|
|
// True, if story notifications are disabled for the chat
|
|
MuteStories bool `json:"mute_stories"`
|
|
// If true, the value for the relevant type of chat is used instead of story_sound_id
|
|
UseDefaultStorySound bool `json:"use_default_story_sound"`
|
|
// Identifier of the notification sound to be played for stories; 0 if sound is disabled
|
|
StorySoundId JsonInt64 `json:"story_sound_id"`
|
|
// If true, the value for the relevant type of chat is used instead of show_story_sender
|
|
UseDefaultShowStorySender bool `json:"use_default_show_story_sender"`
|
|
// True, if the sender of stories must be displayed in notifications
|
|
ShowStorySender bool `json:"show_story_sender"`
|
|
// If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications
|
|
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"`
|
|
// If true, the value for the relevant type of chat or the forum chat is used instead of disable_mention_notifications
|
|
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"`
|
|
}
|
|
|
|
func (entity *ChatNotificationSettings) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatNotificationSettings
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatNotificationSettings) GetClass() string {
|
|
return ClassChatNotificationSettings
|
|
}
|
|
|
|
func (*ChatNotificationSettings) GetType() string {
|
|
return TypeChatNotificationSettings
|
|
}
|
|
|
|
// Contains information about notification settings for several chats
|
|
type ScopeNotificationSettings struct {
|
|
meta
|
|
// Time left before notifications will be unmuted, in seconds
|
|
MuteFor int32 `json:"mute_for"`
|
|
// Identifier of the notification sound to be played; 0 if sound is disabled
|
|
SoundId JsonInt64 `json:"sound_id"`
|
|
// True, if message content must be displayed in notifications
|
|
ShowPreview bool `json:"show_preview"`
|
|
// If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories
|
|
UseDefaultMuteStories bool `json:"use_default_mute_stories"`
|
|
// True, if story notifications are disabled
|
|
MuteStories bool `json:"mute_stories"`
|
|
// Identifier of the notification sound to be played for stories; 0 if sound is disabled
|
|
StorySoundId JsonInt64 `json:"story_sound_id"`
|
|
// True, if the sender of stories must be displayed in notifications
|
|
ShowStorySender bool `json:"show_story_sender"`
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *ScopeNotificationSettings) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ScopeNotificationSettings
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ScopeNotificationSettings) GetClass() string {
|
|
return ClassScopeNotificationSettings
|
|
}
|
|
|
|
func (*ScopeNotificationSettings) GetType() string {
|
|
return TypeScopeNotificationSettings
|
|
}
|
|
|
|
// Contains information about a message draft
|
|
type DraftMessage struct {
|
|
meta
|
|
// Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none
|
|
ReplyTo InputMessageReplyTo `json:"reply_to"`
|
|
// 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, inputMessageVideoNote, or inputMessageVoiceNote
|
|
InputMessageText InputMessageContent `json:"input_message_text"`
|
|
}
|
|
|
|
func (entity *DraftMessage) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub DraftMessage
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*DraftMessage) GetClass() string {
|
|
return ClassDraftMessage
|
|
}
|
|
|
|
func (*DraftMessage) GetType() string {
|
|
return TypeDraftMessage
|
|
}
|
|
|
|
func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
ReplyTo json.RawMessage `json:"reply_to"`
|
|
Date int32 `json:"date"`
|
|
InputMessageText json.RawMessage `json:"input_message_text"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
draftMessage.Date = tmp.Date
|
|
|
|
fieldReplyTo, _ := UnmarshalInputMessageReplyTo(tmp.ReplyTo)
|
|
draftMessage.ReplyTo = fieldReplyTo
|
|
|
|
fieldInputMessageText, _ := UnmarshalInputMessageContent(tmp.InputMessageText)
|
|
draftMessage.InputMessageText = fieldInputMessageText
|
|
|
|
return nil
|
|
}
|
|
|
|
// An ordinary chat with a user
|
|
type ChatTypePrivate struct {
|
|
meta
|
|
// User identifier
|
|
UserId int64 `json:"user_id"`
|
|
}
|
|
|
|
func (entity *ChatTypePrivate) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatTypePrivate
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatTypePrivate) GetClass() string {
|
|
return ClassChatType
|
|
}
|
|
|
|
func (*ChatTypePrivate) GetType() string {
|
|
return TypeChatTypePrivate
|
|
}
|
|
|
|
func (*ChatTypePrivate) ChatTypeType() string {
|
|
return TypeChatTypePrivate
|
|
}
|
|
|
|
// A basic group (a chat with 0-200 other users)
|
|
type ChatTypeBasicGroup struct {
|
|
meta
|
|
// Basic group identifier
|
|
BasicGroupId int64 `json:"basic_group_id"`
|
|
}
|
|
|
|
func (entity *ChatTypeBasicGroup) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatTypeBasicGroup
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatTypeBasicGroup) GetClass() string {
|
|
return ClassChatType
|
|
}
|
|
|
|
func (*ChatTypeBasicGroup) GetType() string {
|
|
return TypeChatTypeBasicGroup
|
|
}
|
|
|
|
func (*ChatTypeBasicGroup) ChatTypeType() string {
|
|
return TypeChatTypeBasicGroup
|
|
}
|
|
|
|
// A supergroup or channel (with unlimited members)
|
|
type ChatTypeSupergroup struct {
|
|
meta
|
|
// Supergroup or channel identifier
|
|
SupergroupId int64 `json:"supergroup_id"`
|
|
// True, if the supergroup is a channel
|
|
IsChannel bool `json:"is_channel"`
|
|
}
|
|
|
|
func (entity *ChatTypeSupergroup) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatTypeSupergroup
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatTypeSupergroup) GetClass() string {
|
|
return ClassChatType
|
|
}
|
|
|
|
func (*ChatTypeSupergroup) GetType() string {
|
|
return TypeChatTypeSupergroup
|
|
}
|
|
|
|
func (*ChatTypeSupergroup) ChatTypeType() string {
|
|
return TypeChatTypeSupergroup
|
|
}
|
|
|
|
// A secret chat with a user
|
|
type ChatTypeSecret struct {
|
|
meta
|
|
// Secret chat identifier
|
|
SecretChatId int32 `json:"secret_chat_id"`
|
|
// User identifier of the other user in the secret chat
|
|
UserId int64 `json:"user_id"`
|
|
}
|
|
|
|
func (entity *ChatTypeSecret) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatTypeSecret
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatTypeSecret) GetClass() string {
|
|
return ClassChatType
|
|
}
|
|
|
|
func (*ChatTypeSecret) GetType() string {
|
|
return TypeChatTypeSecret
|
|
}
|
|
|
|
func (*ChatTypeSecret) ChatTypeType() string {
|
|
return TypeChatTypeSecret
|
|
}
|
|
|
|
// Represents an icon for a chat folder
|
|
type ChatFolderIcon struct {
|
|
meta
|
|
// The chosen icon name for short folder 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"
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
func (entity *ChatFolderIcon) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatFolderIcon
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatFolderIcon) GetClass() string {
|
|
return ClassChatFolderIcon
|
|
}
|
|
|
|
func (*ChatFolderIcon) GetType() string {
|
|
return TypeChatFolderIcon
|
|
}
|
|
|
|
// Represents a folder for user chats
|
|
type ChatFolder struct {
|
|
meta
|
|
// The title of the folder; 1-12 characters without line feeds
|
|
Title string `json:"title"`
|
|
// The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder
|
|
Icon *ChatFolderIcon `json:"icon"`
|
|
// The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription
|
|
ColorId int32 `json:"color_id"`
|
|
// True, if at least one link has been created for the folder
|
|
IsShareable bool `json:"is_shareable"`
|
|
// The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_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
|
|
PinnedChatIds []int64 `json:"pinned_chat_ids"`
|
|
// The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_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
|
|
IncludedChatIds []int64 `json:"included_chat_ids"`
|
|
// The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_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
|
|
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"`
|
|
}
|
|
|
|
func (entity *ChatFolder) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatFolder
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatFolder) GetClass() string {
|
|
return ClassChatFolder
|
|
}
|
|
|
|
func (*ChatFolder) GetType() string {
|
|
return TypeChatFolder
|
|
}
|
|
|
|
// Contains basic information about a chat folder
|
|
type ChatFolderInfo struct {
|
|
meta
|
|
// Unique chat folder identifier
|
|
Id int32 `json:"id"`
|
|
// The title of the folder; 1-12 characters without line feeds
|
|
Title string `json:"title"`
|
|
// The chosen or default icon for the chat folder
|
|
Icon *ChatFolderIcon `json:"icon"`
|
|
// The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled
|
|
ColorId int32 `json:"color_id"`
|
|
// True, if at least one link has been created for the folder
|
|
IsShareable bool `json:"is_shareable"`
|
|
// True, if the chat folder has invite links created by the current user
|
|
HasMyInviteLinks bool `json:"has_my_invite_links"`
|
|
}
|
|
|
|
func (entity *ChatFolderInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatFolderInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatFolderInfo) GetClass() string {
|
|
return ClassChatFolderInfo
|
|
}
|
|
|
|
func (*ChatFolderInfo) GetType() string {
|
|
return TypeChatFolderInfo
|
|
}
|
|
|
|
// Contains a chat folder invite link
|
|
type ChatFolderInviteLink struct {
|
|
meta
|
|
// The chat folder invite link
|
|
InviteLink string `json:"invite_link"`
|
|
// Name of the link
|
|
Name string `json:"name"`
|
|
// Identifiers of chats, included in the link
|
|
ChatIds []int64 `json:"chat_ids"`
|
|
}
|
|
|
|
func (entity *ChatFolderInviteLink) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatFolderInviteLink
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatFolderInviteLink) GetClass() string {
|
|
return ClassChatFolderInviteLink
|
|
}
|
|
|
|
func (*ChatFolderInviteLink) GetType() string {
|
|
return TypeChatFolderInviteLink
|
|
}
|
|
|
|
// Represents a list of chat folder invite links
|
|
type ChatFolderInviteLinks struct {
|
|
meta
|
|
// List of the invite links
|
|
InviteLinks []*ChatFolderInviteLink `json:"invite_links"`
|
|
}
|
|
|
|
func (entity *ChatFolderInviteLinks) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatFolderInviteLinks
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatFolderInviteLinks) GetClass() string {
|
|
return ClassChatFolderInviteLinks
|
|
}
|
|
|
|
func (*ChatFolderInviteLinks) GetType() string {
|
|
return TypeChatFolderInviteLinks
|
|
}
|
|
|
|
// Contains information about an invite link to a chat folder
|
|
type ChatFolderInviteLinkInfo struct {
|
|
meta
|
|
// Basic information about the chat folder; chat folder identifier will be 0 if the user didn't have the chat folder yet
|
|
ChatFolderInfo *ChatFolderInfo `json:"chat_folder_info"`
|
|
// Identifiers of the chats from the link, which aren't added to the folder yet
|
|
MissingChatIds []int64 `json:"missing_chat_ids"`
|
|
// Identifiers of the chats from the link, which are added to the folder already
|
|
AddedChatIds []int64 `json:"added_chat_ids"`
|
|
}
|
|
|
|
func (entity *ChatFolderInviteLinkInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatFolderInviteLinkInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatFolderInviteLinkInfo) GetClass() string {
|
|
return ClassChatFolderInviteLinkInfo
|
|
}
|
|
|
|
func (*ChatFolderInviteLinkInfo) GetType() string {
|
|
return TypeChatFolderInviteLinkInfo
|
|
}
|
|
|
|
// Describes a recommended chat folder
|
|
type RecommendedChatFolder struct {
|
|
meta
|
|
// The chat folder
|
|
Folder *ChatFolder `json:"folder"`
|
|
// Chat folder description
|
|
Description string `json:"description"`
|
|
}
|
|
|
|
func (entity *RecommendedChatFolder) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RecommendedChatFolder
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RecommendedChatFolder) GetClass() string {
|
|
return ClassRecommendedChatFolder
|
|
}
|
|
|
|
func (*RecommendedChatFolder) GetType() string {
|
|
return TypeRecommendedChatFolder
|
|
}
|
|
|
|
// Contains a list of recommended chat folders
|
|
type RecommendedChatFolders struct {
|
|
meta
|
|
// List of recommended chat folders
|
|
ChatFolders []*RecommendedChatFolder `json:"chat_folders"`
|
|
}
|
|
|
|
func (entity *RecommendedChatFolders) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RecommendedChatFolders
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RecommendedChatFolders) GetClass() string {
|
|
return ClassRecommendedChatFolders
|
|
}
|
|
|
|
func (*RecommendedChatFolders) GetType() string {
|
|
return TypeRecommendedChatFolders
|
|
}
|
|
|
|
// Contains settings for automatic moving of chats to and from the Archive chat lists
|
|
type ArchiveChatListSettings struct {
|
|
meta
|
|
// True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true
|
|
ArchiveAndMuteNewChatsFromUnknownUsers bool `json:"archive_and_mute_new_chats_from_unknown_users"`
|
|
// True, if unmuted chats will be kept in the Archive chat list when they get a new message
|
|
KeepUnmutedChatsArchived bool `json:"keep_unmuted_chats_archived"`
|
|
// True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true
|
|
KeepChatsFromFoldersArchived bool `json:"keep_chats_from_folders_archived"`
|
|
}
|
|
|
|
func (entity *ArchiveChatListSettings) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ArchiveChatListSettings
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ArchiveChatListSettings) GetClass() string {
|
|
return ClassArchiveChatListSettings
|
|
}
|
|
|
|
func (*ArchiveChatListSettings) GetType() string {
|
|
return TypeArchiveChatListSettings
|
|
}
|
|
|
|
// A main list of chats
|
|
type ChatListMain struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ChatListMain) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatListMain
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatListMain) GetClass() string {
|
|
return ClassChatList
|
|
}
|
|
|
|
func (*ChatListMain) GetType() string {
|
|
return TypeChatListMain
|
|
}
|
|
|
|
func (*ChatListMain) ChatListType() string {
|
|
return TypeChatListMain
|
|
}
|
|
|
|
// 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{
|
|
meta
|
|
}
|
|
|
|
func (entity *ChatListArchive) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatListArchive
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatListArchive) GetClass() string {
|
|
return ClassChatList
|
|
}
|
|
|
|
func (*ChatListArchive) GetType() string {
|
|
return TypeChatListArchive
|
|
}
|
|
|
|
func (*ChatListArchive) ChatListType() string {
|
|
return TypeChatListArchive
|
|
}
|
|
|
|
// A list of chats added to a chat folder
|
|
type ChatListFolder struct {
|
|
meta
|
|
// Chat folder identifier
|
|
ChatFolderId int32 `json:"chat_folder_id"`
|
|
}
|
|
|
|
func (entity *ChatListFolder) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatListFolder
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatListFolder) GetClass() string {
|
|
return ClassChatList
|
|
}
|
|
|
|
func (*ChatListFolder) GetType() string {
|
|
return TypeChatListFolder
|
|
}
|
|
|
|
func (*ChatListFolder) ChatListType() string {
|
|
return TypeChatListFolder
|
|
}
|
|
|
|
// Contains a list of chat lists
|
|
type ChatLists struct {
|
|
meta
|
|
// List of chat lists
|
|
ChatLists []ChatList `json:"chat_lists"`
|
|
}
|
|
|
|
func (entity *ChatLists) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatLists
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatLists) GetClass() string {
|
|
return ClassChatLists
|
|
}
|
|
|
|
func (*ChatLists) GetType() string {
|
|
return TypeChatLists
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// The chat is sponsored by the user's MTProxy server
|
|
type ChatSourceMtprotoProxy struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ChatSourceMtprotoProxy) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatSourceMtprotoProxy
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatSourceMtprotoProxy) GetClass() string {
|
|
return ClassChatSource
|
|
}
|
|
|
|
func (*ChatSourceMtprotoProxy) GetType() string {
|
|
return TypeChatSourceMtprotoProxy
|
|
}
|
|
|
|
func (*ChatSourceMtprotoProxy) ChatSourceType() string {
|
|
return TypeChatSourceMtprotoProxy
|
|
}
|
|
|
|
// The chat contains a public service announcement
|
|
type ChatSourcePublicServiceAnnouncement struct {
|
|
meta
|
|
// The type of the announcement
|
|
Type string `json:"type"`
|
|
// The text of the announcement
|
|
Text string `json:"text"`
|
|
}
|
|
|
|
func (entity *ChatSourcePublicServiceAnnouncement) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatSourcePublicServiceAnnouncement
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatSourcePublicServiceAnnouncement) GetClass() string {
|
|
return ClassChatSource
|
|
}
|
|
|
|
func (*ChatSourcePublicServiceAnnouncement) GetType() string {
|
|
return TypeChatSourcePublicServiceAnnouncement
|
|
}
|
|
|
|
func (*ChatSourcePublicServiceAnnouncement) ChatSourceType() string {
|
|
return TypeChatSourcePublicServiceAnnouncement
|
|
}
|
|
|
|
// Describes a position of a chat in a chat list
|
|
type ChatPosition struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *ChatPosition) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatPosition
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatPosition) GetClass() string {
|
|
return ClassChatPosition
|
|
}
|
|
|
|
func (*ChatPosition) GetType() string {
|
|
return TypeChatPosition
|
|
}
|
|
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
chatPosition.Order = tmp.Order
|
|
chatPosition.IsPinned = tmp.IsPinned
|
|
|
|
fieldList, _ := UnmarshalChatList(tmp.List)
|
|
chatPosition.List = fieldList
|
|
|
|
fieldSource, _ := UnmarshalChatSource(tmp.Source)
|
|
chatPosition.Source = fieldSource
|
|
|
|
return nil
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// Represents a tag used in Saved Messages or a Saved Messages topic
|
|
type SavedMessagesTag struct {
|
|
meta
|
|
// The tag
|
|
Tag ReactionType `json:"tag"`
|
|
// Label of the tag; 0-12 characters. Always empty if the tag is returned for a Saved Messages topic
|
|
Label string `json:"label"`
|
|
// Number of times the tag was used; may be 0 if the tag has non-empty label
|
|
Count int32 `json:"count"`
|
|
}
|
|
|
|
func (entity *SavedMessagesTag) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SavedMessagesTag
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SavedMessagesTag) GetClass() string {
|
|
return ClassSavedMessagesTag
|
|
}
|
|
|
|
func (*SavedMessagesTag) GetType() string {
|
|
return TypeSavedMessagesTag
|
|
}
|
|
|
|
func (savedMessagesTag *SavedMessagesTag) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Tag json.RawMessage `json:"tag"`
|
|
Label string `json:"label"`
|
|
Count int32 `json:"count"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
savedMessagesTag.Label = tmp.Label
|
|
savedMessagesTag.Count = tmp.Count
|
|
|
|
fieldTag, _ := UnmarshalReactionType(tmp.Tag)
|
|
savedMessagesTag.Tag = fieldTag
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains a list of tags used in Saved Messages
|
|
type SavedMessagesTags struct {
|
|
meta
|
|
// List of tags
|
|
Tags []*SavedMessagesTag `json:"tags"`
|
|
}
|
|
|
|
func (entity *SavedMessagesTags) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SavedMessagesTags
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SavedMessagesTags) GetClass() string {
|
|
return ClassSavedMessagesTags
|
|
}
|
|
|
|
func (*SavedMessagesTags) GetType() string {
|
|
return TypeSavedMessagesTags
|
|
}
|
|
|
|
// Describes a video chat
|
|
type VideoChat struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *VideoChat) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub VideoChat
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*VideoChat) GetClass() string {
|
|
return ClassVideoChat
|
|
}
|
|
|
|
func (*VideoChat) GetType() string {
|
|
return TypeVideoChat
|
|
}
|
|
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
videoChat.GroupCallId = tmp.GroupCallId
|
|
videoChat.HasParticipants = tmp.HasParticipants
|
|
|
|
fieldDefaultParticipantId, _ := UnmarshalMessageSender(tmp.DefaultParticipantId)
|
|
videoChat.DefaultParticipantId = fieldDefaultParticipantId
|
|
|
|
return nil
|
|
}
|
|
|
|
// A chat. (Can be a private chat, basic group, supergroup, or secret chat)
|
|
type Chat struct {
|
|
meta
|
|
// 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"`
|
|
// Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview
|
|
AccentColorId int32 `json:"accent_color_id"`
|
|
// Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none
|
|
BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"`
|
|
// Identifier of the profile accent color for the chat's profile; -1 if none
|
|
ProfileAccentColorId int32 `json:"profile_accent_color_id"`
|
|
// Identifier of a custom emoji to be shown on the background of the chat's profile; 0 if none
|
|
ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"`
|
|
// 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 if none or unknown
|
|
LastMessage *Message `json:"last_message"`
|
|
// Positions of the chat in chat lists
|
|
Positions []*ChatPosition `json:"positions"`
|
|
// Chat lists to which the chat belongs. A chat can have a non-zero position in a chat list even it doesn't belong to the chat list and have no position in a chat list even it belongs to the chat list
|
|
ChatLists []ChatList `json:"chat_lists"`
|
|
// 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"`
|
|
// Block list to which the chat is added; may be null if none
|
|
BlockList BlockList `json:"block_list"`
|
|
// True, if chat content can't be saved locally, forwarded, or copied
|
|
HasProtectedContent bool `json:"has_protected_content"`
|
|
// True, if translation of all messages in the chat must be suggested to the user
|
|
IsTranslatable bool `json:"is_translatable"`
|
|
// True, if the chat is marked as unread
|
|
IsMarkedAsUnread bool `json:"is_marked_as_unread"`
|
|
// True, if the chat is a forum supergroup that must be shown in the "View as topics" mode, or Saved Messages chat that must be shown in the "View as chats"
|
|
ViewAsTopics bool `json:"view_as_topics"`
|
|
// 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"`
|
|
// Number of messages with unread reactions in the chat
|
|
UnreadReactionCount int32 `json:"unread_reaction_count"`
|
|
// Notification settings for the chat
|
|
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
|
|
// 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"`
|
|
// Emoji status to be shown along with chat title; may be null
|
|
EmojiStatus *EmojiStatus `json:"emoji_status"`
|
|
// Background set for the chat; may be null if none
|
|
Background *ChatBackground `json:"background"`
|
|
// 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 if none
|
|
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 if none
|
|
PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"`
|
|
// Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
|
|
ReplyMarkupMessageId int64 `json:"reply_markup_message_id"`
|
|
// A draft of a message in the chat; may be null if none
|
|
DraftMessage *DraftMessage `json:"draft_message"`
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *Chat) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub Chat
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*Chat) GetClass() string {
|
|
return ClassChat
|
|
}
|
|
|
|
func (*Chat) GetType() string {
|
|
return TypeChat
|
|
}
|
|
|
|
func (chat *Chat) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Id int64 `json:"id"`
|
|
Type json.RawMessage `json:"type"`
|
|
Title string `json:"title"`
|
|
Photo *ChatPhotoInfo `json:"photo"`
|
|
AccentColorId int32 `json:"accent_color_id"`
|
|
BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"`
|
|
ProfileAccentColorId int32 `json:"profile_accent_color_id"`
|
|
ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"`
|
|
Permissions *ChatPermissions `json:"permissions"`
|
|
LastMessage *Message `json:"last_message"`
|
|
Positions []*ChatPosition `json:"positions"`
|
|
ChatLists []json.RawMessage `json:"chat_lists"`
|
|
MessageSenderId json.RawMessage `json:"message_sender_id"`
|
|
BlockList json.RawMessage `json:"block_list"`
|
|
HasProtectedContent bool `json:"has_protected_content"`
|
|
IsTranslatable bool `json:"is_translatable"`
|
|
IsMarkedAsUnread bool `json:"is_marked_as_unread"`
|
|
ViewAsTopics bool `json:"view_as_topics"`
|
|
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"`
|
|
UnreadReactionCount int32 `json:"unread_reaction_count"`
|
|
NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
|
|
AvailableReactions json.RawMessage `json:"available_reactions"`
|
|
MessageAutoDeleteTime int32 `json:"message_auto_delete_time"`
|
|
EmojiStatus *EmojiStatus `json:"emoji_status"`
|
|
Background *ChatBackground `json:"background"`
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
chat.Id = tmp.Id
|
|
chat.Title = tmp.Title
|
|
chat.Photo = tmp.Photo
|
|
chat.AccentColorId = tmp.AccentColorId
|
|
chat.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId
|
|
chat.ProfileAccentColorId = tmp.ProfileAccentColorId
|
|
chat.ProfileBackgroundCustomEmojiId = tmp.ProfileBackgroundCustomEmojiId
|
|
chat.Permissions = tmp.Permissions
|
|
chat.LastMessage = tmp.LastMessage
|
|
chat.Positions = tmp.Positions
|
|
chat.HasProtectedContent = tmp.HasProtectedContent
|
|
chat.IsTranslatable = tmp.IsTranslatable
|
|
chat.IsMarkedAsUnread = tmp.IsMarkedAsUnread
|
|
chat.ViewAsTopics = tmp.ViewAsTopics
|
|
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
|
|
chat.UnreadReactionCount = tmp.UnreadReactionCount
|
|
chat.NotificationSettings = tmp.NotificationSettings
|
|
chat.MessageAutoDeleteTime = tmp.MessageAutoDeleteTime
|
|
chat.EmojiStatus = tmp.EmojiStatus
|
|
chat.Background = tmp.Background
|
|
chat.ThemeName = tmp.ThemeName
|
|
chat.VideoChat = tmp.VideoChat
|
|
chat.PendingJoinRequests = tmp.PendingJoinRequests
|
|
chat.ReplyMarkupMessageId = tmp.ReplyMarkupMessageId
|
|
chat.DraftMessage = tmp.DraftMessage
|
|
chat.ClientData = tmp.ClientData
|
|
|
|
fieldType, _ := UnmarshalChatType(tmp.Type)
|
|
chat.Type = fieldType
|
|
|
|
fieldChatLists, _ := UnmarshalListOfChatList(tmp.ChatLists)
|
|
chat.ChatLists = fieldChatLists
|
|
|
|
fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId)
|
|
chat.MessageSenderId = fieldMessageSenderId
|
|
|
|
fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList)
|
|
chat.BlockList = fieldBlockList
|
|
|
|
fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions)
|
|
chat.AvailableReactions = fieldAvailableReactions
|
|
|
|
fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar)
|
|
chat.ActionBar = fieldActionBar
|
|
|
|
return nil
|
|
}
|
|
|
|
// Represents a list of chats
|
|
type Chats struct {
|
|
meta
|
|
// Approximate total number of chats found
|
|
TotalCount int32 `json:"total_count"`
|
|
// List of chat identifiers
|
|
ChatIds []int64 `json:"chat_ids"`
|
|
}
|
|
|
|
func (entity *Chats) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub Chats
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*Chats) GetClass() string {
|
|
return ClassChats
|
|
}
|
|
|
|
func (*Chats) GetType() string {
|
|
return TypeChats
|
|
}
|
|
|
|
// Describes a chat located nearby
|
|
type ChatNearby struct {
|
|
meta
|
|
// Chat identifier
|
|
ChatId int64 `json:"chat_id"`
|
|
// Distance to the chat location, in meters
|
|
Distance int32 `json:"distance"`
|
|
}
|
|
|
|
func (entity *ChatNearby) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatNearby
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatNearby) GetClass() string {
|
|
return ClassChatNearby
|
|
}
|
|
|
|
func (*ChatNearby) GetType() string {
|
|
return TypeChatNearby
|
|
}
|
|
|
|
// Represents a list of chats located nearby
|
|
type ChatsNearby struct {
|
|
meta
|
|
// List of users nearby
|
|
UsersNearby []*ChatNearby `json:"users_nearby"`
|
|
// List of location-based supergroups nearby
|
|
SupergroupsNearby []*ChatNearby `json:"supergroups_nearby"`
|
|
}
|
|
|
|
func (entity *ChatsNearby) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatsNearby
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatsNearby) GetClass() string {
|
|
return ClassChatsNearby
|
|
}
|
|
|
|
func (*ChatsNearby) GetType() string {
|
|
return TypeChatsNearby
|
|
}
|
|
|
|
// The chat is public, because it has an active username
|
|
type PublicChatTypeHasUsername struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PublicChatTypeHasUsername) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PublicChatTypeHasUsername
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PublicChatTypeHasUsername) GetClass() string {
|
|
return ClassPublicChatType
|
|
}
|
|
|
|
func (*PublicChatTypeHasUsername) GetType() string {
|
|
return TypePublicChatTypeHasUsername
|
|
}
|
|
|
|
func (*PublicChatTypeHasUsername) PublicChatTypeType() string {
|
|
return TypePublicChatTypeHasUsername
|
|
}
|
|
|
|
// The chat is public, because it is a location-based supergroup
|
|
type PublicChatTypeIsLocationBased struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PublicChatTypeIsLocationBased) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PublicChatTypeIsLocationBased
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PublicChatTypeIsLocationBased) GetClass() string {
|
|
return ClassPublicChatType
|
|
}
|
|
|
|
func (*PublicChatTypeIsLocationBased) GetType() string {
|
|
return TypePublicChatTypeIsLocationBased
|
|
}
|
|
|
|
func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string {
|
|
return TypePublicChatTypeIsLocationBased
|
|
}
|
|
|
|
// The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
|
|
type ChatActionBarReportSpam struct {
|
|
meta
|
|
// If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
|
|
CanUnarchive bool `json:"can_unarchive"`
|
|
}
|
|
|
|
func (entity *ChatActionBarReportSpam) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatActionBarReportSpam
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatActionBarReportSpam) GetClass() string {
|
|
return ClassChatActionBar
|
|
}
|
|
|
|
func (*ChatActionBarReportSpam) GetType() string {
|
|
return TypeChatActionBarReportSpam
|
|
}
|
|
|
|
func (*ChatActionBarReportSpam) ChatActionBarType() string {
|
|
return TypeChatActionBarReportSpam
|
|
}
|
|
|
|
// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation
|
|
type ChatActionBarReportUnrelatedLocation struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ChatActionBarReportUnrelatedLocation) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatActionBarReportUnrelatedLocation
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatActionBarReportUnrelatedLocation) GetClass() string {
|
|
return ClassChatActionBar
|
|
}
|
|
|
|
func (*ChatActionBarReportUnrelatedLocation) GetType() string {
|
|
return TypeChatActionBarReportUnrelatedLocation
|
|
}
|
|
|
|
func (*ChatActionBarReportUnrelatedLocation) ChatActionBarType() string {
|
|
return TypeChatActionBarReportUnrelatedLocation
|
|
}
|
|
|
|
// The chat is a recently created group chat to which new members can be invited
|
|
type ChatActionBarInviteMembers struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *ChatActionBarInviteMembers) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatActionBarInviteMembers
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatActionBarInviteMembers) GetClass() string {
|
|
return ClassChatActionBar
|
|
}
|
|
|
|
func (*ChatActionBarInviteMembers) GetType() string {
|
|
return TypeChatActionBarInviteMembers
|
|
}
|
|
|
|
func (*ChatActionBarInviteMembers) ChatActionBarType() string {
|
|
return TypeChatActionBarInviteMembers
|
|
}
|
|
|
|
// 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 setMessageSenderBlockList, 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
|
|
type ChatActionBarReportAddBlock struct {
|
|
meta
|
|
// If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
|
|
CanUnarchive bool `json:"can_unarchive"`
|
|
// If non-negative, the current user was found by the other user through searchChatsNearby and this is the distance between the users
|
|
Distance int32 `json:"distance"`
|
|
}
|
|
|
|
func (entity *ChatActionBarReportAddBlock) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatActionBarReportAddBlock
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatActionBarReportAddBlock) GetClass() string {
|
|
return ClassChatActionBar
|
|
}
|
|
|
|
func (*ChatActionBarReportAddBlock) GetType() string {
|
|
return TypeChatActionBarReportAddBlock
|
|
}
|
|
|
|
func (*ChatActionBarReportAddBlock) ChatActionBarType() string {
|
|
return TypeChatActionBarReportAddBlock
|
|
}
|
|
|
|
// 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{
|
|
meta
|
|
}
|
|
|
|
func (entity *ChatActionBarAddContact) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatActionBarAddContact
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatActionBarAddContact) GetClass() string {
|
|
return ClassChatActionBar
|
|
}
|
|
|
|
func (*ChatActionBarAddContact) GetType() string {
|
|
return TypeChatActionBarAddContact
|
|
}
|
|
|
|
func (*ChatActionBarAddContact) ChatActionBarType() string {
|
|
return TypeChatActionBarAddContact
|
|
}
|
|
|
|
// 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{
|
|
meta
|
|
}
|
|
|
|
func (entity *ChatActionBarSharePhoneNumber) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatActionBarSharePhoneNumber
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatActionBarSharePhoneNumber) GetClass() string {
|
|
return ClassChatActionBar
|
|
}
|
|
|
|
func (*ChatActionBarSharePhoneNumber) GetType() string {
|
|
return TypeChatActionBarSharePhoneNumber
|
|
}
|
|
|
|
func (*ChatActionBarSharePhoneNumber) ChatActionBarType() string {
|
|
return TypeChatActionBarSharePhoneNumber
|
|
}
|
|
|
|
// The chat is a private chat with an administrator of a chat to which the user sent join request
|
|
type ChatActionBarJoinRequest struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *ChatActionBarJoinRequest) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ChatActionBarJoinRequest
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ChatActionBarJoinRequest) GetClass() string {
|
|
return ClassChatActionBar
|
|
}
|
|
|
|
func (*ChatActionBarJoinRequest) GetType() string {
|
|
return TypeChatActionBarJoinRequest
|
|
}
|
|
|
|
func (*ChatActionBarJoinRequest) ChatActionBarType() string {
|
|
return TypeChatActionBarJoinRequest
|
|
}
|
|
|
|
// A simple button, with text that must be sent when the button is pressed
|
|
type KeyboardButtonTypeText struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *KeyboardButtonTypeText) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub KeyboardButtonTypeText
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*KeyboardButtonTypeText) GetClass() string {
|
|
return ClassKeyboardButtonType
|
|
}
|
|
|
|
func (*KeyboardButtonTypeText) GetType() string {
|
|
return TypeKeyboardButtonTypeText
|
|
}
|
|
|
|
func (*KeyboardButtonTypeText) KeyboardButtonTypeType() string {
|
|
return TypeKeyboardButtonTypeText
|
|
}
|
|
|
|
// A button that sends the user's phone number when pressed; available only in private chats
|
|
type KeyboardButtonTypeRequestPhoneNumber struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *KeyboardButtonTypeRequestPhoneNumber) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub KeyboardButtonTypeRequestPhoneNumber
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestPhoneNumber) GetClass() string {
|
|
return ClassKeyboardButtonType
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestPhoneNumber) GetType() string {
|
|
return TypeKeyboardButtonTypeRequestPhoneNumber
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestPhoneNumber) KeyboardButtonTypeType() string {
|
|
return TypeKeyboardButtonTypeRequestPhoneNumber
|
|
}
|
|
|
|
// A button that sends the user's location when pressed; available only in private chats
|
|
type KeyboardButtonTypeRequestLocation struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *KeyboardButtonTypeRequestLocation) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub KeyboardButtonTypeRequestLocation
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestLocation) GetClass() string {
|
|
return ClassKeyboardButtonType
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestLocation) GetType() string {
|
|
return TypeKeyboardButtonTypeRequestLocation
|
|
}
|
|
|
|
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 {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *KeyboardButtonTypeRequestPoll) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub KeyboardButtonTypeRequestPoll
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestPoll) GetClass() string {
|
|
return ClassKeyboardButtonType
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestPoll) GetType() string {
|
|
return TypeKeyboardButtonTypeRequestPoll
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestPoll) KeyboardButtonTypeType() string {
|
|
return TypeKeyboardButtonTypeRequestPoll
|
|
}
|
|
|
|
// A button that requests users to be shared by the current user; available only in private chats. Use the method shareUsersWithBot to complete the request
|
|
type KeyboardButtonTypeRequestUsers struct {
|
|
meta
|
|
// Unique button identifier
|
|
Id int32 `json:"id"`
|
|
// True, if the shared users must or must not be bots
|
|
RestrictUserIsBot bool `json:"restrict_user_is_bot"`
|
|
// True, if the shared users must be bots; otherwise, the shared users must not be bots. Ignored if restrict_user_is_bot is false
|
|
UserIsBot bool `json:"user_is_bot"`
|
|
// True, if the shared users must or must not be Telegram Premium users
|
|
RestrictUserIsPremium bool `json:"restrict_user_is_premium"`
|
|
// True, if the shared users must be Telegram Premium users; otherwise, the shared users must not be Telegram Premium users. Ignored if restrict_user_is_premium is false
|
|
UserIsPremium bool `json:"user_is_premium"`
|
|
// The maximum number of users to share
|
|
MaxQuantity int32 `json:"max_quantity"`
|
|
// Pass true to request name of the users; bots only
|
|
RequestName bool `json:"request_name"`
|
|
// Pass true to request username of the users; bots only
|
|
RequestUsername bool `json:"request_username"`
|
|
// Pass true to request photo of the users; bots only
|
|
RequestPhoto bool `json:"request_photo"`
|
|
}
|
|
|
|
func (entity *KeyboardButtonTypeRequestUsers) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub KeyboardButtonTypeRequestUsers
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestUsers) GetClass() string {
|
|
return ClassKeyboardButtonType
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestUsers) GetType() string {
|
|
return TypeKeyboardButtonTypeRequestUsers
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestUsers) KeyboardButtonTypeType() string {
|
|
return TypeKeyboardButtonTypeRequestUsers
|
|
}
|
|
|
|
// A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request
|
|
type KeyboardButtonTypeRequestChat struct {
|
|
meta
|
|
// Unique button identifier
|
|
Id int32 `json:"id"`
|
|
// True, if the chat must be a channel; otherwise, a basic group or a supergroup chat is shared
|
|
ChatIsChannel bool `json:"chat_is_channel"`
|
|
// True, if the chat must or must not be a forum supergroup
|
|
RestrictChatIsForum bool `json:"restrict_chat_is_forum"`
|
|
// True, if the chat must be a forum supergroup; otherwise, the chat must not be a forum supergroup. Ignored if restrict_chat_is_forum is false
|
|
ChatIsForum bool `json:"chat_is_forum"`
|
|
// True, if the chat must or must not have a username
|
|
RestrictChatHasUsername bool `json:"restrict_chat_has_username"`
|
|
// True, if the chat must have a username; otherwise, the chat must not have a username. Ignored if restrict_chat_has_username is false
|
|
ChatHasUsername bool `json:"chat_has_username"`
|
|
// True, if the chat must be created by the current user
|
|
ChatIsCreated bool `json:"chat_is_created"`
|
|
// Expected user administrator rights in the chat; may be null if they aren't restricted
|
|
UserAdministratorRights *ChatAdministratorRights `json:"user_administrator_rights"`
|
|
// Expected bot administrator rights in the chat; may be null if they aren't restricted
|
|
BotAdministratorRights *ChatAdministratorRights `json:"bot_administrator_rights"`
|
|
// True, if the bot must be a member of the chat; for basic group and supergroup chats only
|
|
BotIsMember bool `json:"bot_is_member"`
|
|
// Pass true to request title of the chat; bots only
|
|
RequestTitle bool `json:"request_title"`
|
|
// Pass true to request username of the chat; bots only
|
|
RequestUsername bool `json:"request_username"`
|
|
// Pass true to request photo of the chat; bots only
|
|
RequestPhoto bool `json:"request_photo"`
|
|
}
|
|
|
|
func (entity *KeyboardButtonTypeRequestChat) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub KeyboardButtonTypeRequestChat
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestChat) GetClass() string {
|
|
return ClassKeyboardButtonType
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestChat) GetType() string {
|
|
return TypeKeyboardButtonTypeRequestChat
|
|
}
|
|
|
|
func (*KeyboardButtonTypeRequestChat) KeyboardButtonTypeType() string {
|
|
return TypeKeyboardButtonTypeRequestChat
|
|
}
|
|
|
|
// A button that opens a Web App by calling getWebAppUrl
|
|
type KeyboardButtonTypeWebApp struct {
|
|
meta
|
|
// 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
|
|
Text string `json:"text"`
|
|
// Type of the button
|
|
Type KeyboardButtonType `json:"type"`
|
|
}
|
|
|
|
func (entity *KeyboardButton) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub KeyboardButton
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*KeyboardButton) GetClass() string {
|
|
return ClassKeyboardButton
|
|
}
|
|
|
|
func (*KeyboardButton) GetType() string {
|
|
return TypeKeyboardButton
|
|
}
|
|
|
|
func (keyboardButton *KeyboardButton) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Text string `json:"text"`
|
|
Type json.RawMessage `json:"type"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
keyboardButton.Text = tmp.Text
|
|
|
|
fieldType, _ := UnmarshalKeyboardButtonType(tmp.Type)
|
|
keyboardButton.Type = fieldType
|
|
|
|
return nil
|
|
}
|
|
|
|
// A button that opens a specified URL
|
|
type InlineKeyboardButtonTypeUrl struct {
|
|
meta
|
|
// HTTP or tg:// URL to open
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
func (entity *InlineKeyboardButtonTypeUrl) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InlineKeyboardButtonTypeUrl
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeUrl) GetClass() string {
|
|
return ClassInlineKeyboardButtonType
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeUrl) GetType() string {
|
|
return TypeInlineKeyboardButtonTypeUrl
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeUrl) InlineKeyboardButtonTypeType() string {
|
|
return TypeInlineKeyboardButtonTypeUrl
|
|
}
|
|
|
|
// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo
|
|
type InlineKeyboardButtonTypeLoginUrl struct {
|
|
meta
|
|
// An HTTP URL to pass to getLoginUrlInfo
|
|
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"`
|
|
}
|
|
|
|
func (entity *InlineKeyboardButtonTypeLoginUrl) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InlineKeyboardButtonTypeLoginUrl
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeLoginUrl) GetClass() string {
|
|
return ClassInlineKeyboardButtonType
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeLoginUrl) GetType() string {
|
|
return TypeInlineKeyboardButtonTypeLoginUrl
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeLoginUrl) InlineKeyboardButtonTypeType() string {
|
|
return TypeInlineKeyboardButtonTypeLoginUrl
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// A button that sends a callback query to a bot
|
|
type InlineKeyboardButtonTypeCallback struct {
|
|
meta
|
|
// Data to be sent to the bot via a callback query
|
|
Data []byte `json:"data"`
|
|
}
|
|
|
|
func (entity *InlineKeyboardButtonTypeCallback) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InlineKeyboardButtonTypeCallback
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeCallback) GetClass() string {
|
|
return ClassInlineKeyboardButtonType
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeCallback) GetType() string {
|
|
return TypeInlineKeyboardButtonTypeCallback
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeCallback) InlineKeyboardButtonTypeType() string {
|
|
return TypeInlineKeyboardButtonTypeCallback
|
|
}
|
|
|
|
// A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot
|
|
type InlineKeyboardButtonTypeCallbackWithPassword struct {
|
|
meta
|
|
// Data to be sent to the bot via a callback query
|
|
Data []byte `json:"data"`
|
|
}
|
|
|
|
func (entity *InlineKeyboardButtonTypeCallbackWithPassword) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InlineKeyboardButtonTypeCallbackWithPassword
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeCallbackWithPassword) GetClass() string {
|
|
return ClassInlineKeyboardButtonType
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeCallbackWithPassword) GetType() string {
|
|
return TypeInlineKeyboardButtonTypeCallbackWithPassword
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeCallbackWithPassword) InlineKeyboardButtonTypeType() string {
|
|
return TypeInlineKeyboardButtonTypeCallbackWithPassword
|
|
}
|
|
|
|
// 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{
|
|
meta
|
|
}
|
|
|
|
func (entity *InlineKeyboardButtonTypeCallbackGame) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InlineKeyboardButtonTypeCallbackGame
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeCallbackGame) GetClass() string {
|
|
return ClassInlineKeyboardButtonType
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeCallbackGame) GetType() string {
|
|
return TypeInlineKeyboardButtonTypeCallbackGame
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeCallbackGame) InlineKeyboardButtonTypeType() string {
|
|
return TypeInlineKeyboardButtonTypeCallbackGame
|
|
}
|
|
|
|
// A button that forces an inline query to the bot to be inserted in the input field
|
|
type InlineKeyboardButtonTypeSwitchInline struct {
|
|
meta
|
|
// Inline query to be sent to the bot
|
|
Query string `json:"query"`
|
|
// Target chat from which to send the inline query
|
|
TargetChat TargetChat `json:"target_chat"`
|
|
}
|
|
|
|
func (entity *InlineKeyboardButtonTypeSwitchInline) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InlineKeyboardButtonTypeSwitchInline
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeSwitchInline) GetClass() string {
|
|
return ClassInlineKeyboardButtonType
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeSwitchInline) GetType() string {
|
|
return TypeInlineKeyboardButtonTypeSwitchInline
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeSwitchInline) InlineKeyboardButtonTypeType() string {
|
|
return TypeInlineKeyboardButtonTypeSwitchInline
|
|
}
|
|
|
|
func (inlineKeyboardButtonTypeSwitchInline *InlineKeyboardButtonTypeSwitchInline) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Query string `json:"query"`
|
|
TargetChat json.RawMessage `json:"target_chat"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
inlineKeyboardButtonTypeSwitchInline.Query = tmp.Query
|
|
|
|
fieldTargetChat, _ := UnmarshalTargetChat(tmp.TargetChat)
|
|
inlineKeyboardButtonTypeSwitchInline.TargetChat = fieldTargetChat
|
|
|
|
return nil
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
func (entity *InlineKeyboardButtonTypeBuy) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InlineKeyboardButtonTypeBuy
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeBuy) GetClass() string {
|
|
return ClassInlineKeyboardButtonType
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeBuy) GetType() string {
|
|
return TypeInlineKeyboardButtonTypeBuy
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeBuy) InlineKeyboardButtonTypeType() string {
|
|
return TypeInlineKeyboardButtonTypeBuy
|
|
}
|
|
|
|
// A button with a user reference to be handled in the same way as textEntityTypeMentionName entities
|
|
type InlineKeyboardButtonTypeUser struct {
|
|
meta
|
|
// User identifier
|
|
UserId int64 `json:"user_id"`
|
|
}
|
|
|
|
func (entity *InlineKeyboardButtonTypeUser) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InlineKeyboardButtonTypeUser
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeUser) GetClass() string {
|
|
return ClassInlineKeyboardButtonType
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeUser) GetType() string {
|
|
return TypeInlineKeyboardButtonTypeUser
|
|
}
|
|
|
|
func (*InlineKeyboardButtonTypeUser) InlineKeyboardButtonTypeType() string {
|
|
return TypeInlineKeyboardButtonTypeUser
|
|
}
|
|
|
|
// Represents a single button in an inline keyboard
|
|
type InlineKeyboardButton struct {
|
|
meta
|
|
// Text of the button
|
|
Text string `json:"text"`
|
|
// Type of the button
|
|
Type InlineKeyboardButtonType `json:"type"`
|
|
}
|
|
|
|
func (entity *InlineKeyboardButton) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InlineKeyboardButton
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InlineKeyboardButton) GetClass() string {
|
|
return ClassInlineKeyboardButton
|
|
}
|
|
|
|
func (*InlineKeyboardButton) GetType() string {
|
|
return TypeInlineKeyboardButton
|
|
}
|
|
|
|
func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Text string `json:"text"`
|
|
Type json.RawMessage `json:"type"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
inlineKeyboardButton.Text = tmp.Text
|
|
|
|
fieldType, _ := UnmarshalInlineKeyboardButtonType(tmp.Type)
|
|
inlineKeyboardButton.Type = fieldType
|
|
|
|
return nil
|
|
}
|
|
|
|
// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, updateChatReplyMarkup with message_id == 0 will be sent
|
|
type ReplyMarkupRemoveKeyboard struct {
|
|
meta
|
|
// True, if the keyboard is removed only for the mentioned users or the target user of a reply
|
|
IsPersonal bool `json:"is_personal"`
|
|
}
|
|
|
|
func (entity *ReplyMarkupRemoveKeyboard) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ReplyMarkupRemoveKeyboard
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ReplyMarkupRemoveKeyboard) GetClass() string {
|
|
return ClassReplyMarkup
|
|
}
|
|
|
|
func (*ReplyMarkupRemoveKeyboard) GetType() string {
|
|
return TypeReplyMarkupRemoveKeyboard
|
|
}
|
|
|
|
func (*ReplyMarkupRemoveKeyboard) ReplyMarkupType() string {
|
|
return TypeReplyMarkupRemoveKeyboard
|
|
}
|
|
|
|
// Instructs application to force a reply to this message
|
|
type ReplyMarkupForceReply struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *ReplyMarkupForceReply) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ReplyMarkupForceReply
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ReplyMarkupForceReply) GetClass() string {
|
|
return ClassReplyMarkup
|
|
}
|
|
|
|
func (*ReplyMarkupForceReply) GetType() string {
|
|
return TypeReplyMarkupForceReply
|
|
}
|
|
|
|
func (*ReplyMarkupForceReply) ReplyMarkupType() string {
|
|
return TypeReplyMarkupForceReply
|
|
}
|
|
|
|
// 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"`
|
|
// True, if the keyboard is supposed to always be shown when the ordinary keyboard is hidden
|
|
IsPersistent bool `json:"is_persistent"`
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *ReplyMarkupShowKeyboard) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ReplyMarkupShowKeyboard
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ReplyMarkupShowKeyboard) GetClass() string {
|
|
return ClassReplyMarkup
|
|
}
|
|
|
|
func (*ReplyMarkupShowKeyboard) GetType() string {
|
|
return TypeReplyMarkupShowKeyboard
|
|
}
|
|
|
|
func (*ReplyMarkupShowKeyboard) ReplyMarkupType() string {
|
|
return TypeReplyMarkupShowKeyboard
|
|
}
|
|
|
|
// Contains an inline keyboard layout
|
|
type ReplyMarkupInlineKeyboard struct {
|
|
meta
|
|
// A list of rows of inline keyboard buttons
|
|
Rows [][]*InlineKeyboardButton `json:"rows"`
|
|
}
|
|
|
|
func (entity *ReplyMarkupInlineKeyboard) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ReplyMarkupInlineKeyboard
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ReplyMarkupInlineKeyboard) GetClass() string {
|
|
return ClassReplyMarkup
|
|
}
|
|
|
|
func (*ReplyMarkupInlineKeyboard) GetType() string {
|
|
return TypeReplyMarkupInlineKeyboard
|
|
}
|
|
|
|
func (*ReplyMarkupInlineKeyboard) ReplyMarkupType() string {
|
|
return TypeReplyMarkupInlineKeyboard
|
|
}
|
|
|
|
// An HTTP URL needs to be open
|
|
type LoginUrlInfoOpen struct {
|
|
meta
|
|
// The URL to open
|
|
Url string `json:"url"`
|
|
// True, if there is no need to show an ordinary open URL confirmation
|
|
SkipConfirmation bool `json:"skip_confirmation"`
|
|
}
|
|
|
|
func (entity *LoginUrlInfoOpen) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub LoginUrlInfoOpen
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*LoginUrlInfoOpen) GetClass() string {
|
|
return ClassLoginUrlInfo
|
|
}
|
|
|
|
func (*LoginUrlInfoOpen) GetType() string {
|
|
return TypeLoginUrlInfoOpen
|
|
}
|
|
|
|
func (*LoginUrlInfoOpen) LoginUrlInfoType() string {
|
|
return TypeLoginUrlInfoOpen
|
|
}
|
|
|
|
// 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 must be asked for the permission to the bot to send them messages
|
|
RequestWriteAccess bool `json:"request_write_access"`
|
|
}
|
|
|
|
func (entity *LoginUrlInfoRequestConfirmation) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub LoginUrlInfoRequestConfirmation
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*LoginUrlInfoRequestConfirmation) GetClass() string {
|
|
return ClassLoginUrlInfo
|
|
}
|
|
|
|
func (*LoginUrlInfoRequestConfirmation) GetType() string {
|
|
return TypeLoginUrlInfoRequestConfirmation
|
|
}
|
|
|
|
func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string {
|
|
return TypeLoginUrlInfoRequestConfirmation
|
|
}
|
|
|
|
// Contains information about a Web App found by its short name
|
|
type FoundWebApp struct {
|
|
meta
|
|
// The Web App
|
|
WebApp *WebApp `json:"web_app"`
|
|
// True, if the user must be asked for the permission to the bot to send them messages
|
|
RequestWriteAccess bool `json:"request_write_access"`
|
|
// True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden
|
|
SkipConfirmation bool `json:"skip_confirmation"`
|
|
}
|
|
|
|
func (entity *FoundWebApp) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub FoundWebApp
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*FoundWebApp) GetClass() string {
|
|
return ClassFoundWebApp
|
|
}
|
|
|
|
func (*FoundWebApp) GetType() string {
|
|
return TypeFoundWebApp
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// Contains information about a message thread
|
|
type MessageThreadInfo struct {
|
|
meta
|
|
// 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"`
|
|
// Information about the message thread; may be null for forum topic threads
|
|
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 if none
|
|
DraftMessage *DraftMessage `json:"draft_message"`
|
|
}
|
|
|
|
func (entity *MessageThreadInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub MessageThreadInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*MessageThreadInfo) GetClass() string {
|
|
return ClassMessageThreadInfo
|
|
}
|
|
|
|
func (*MessageThreadInfo) GetType() string {
|
|
return TypeMessageThreadInfo
|
|
}
|
|
|
|
// Topic containing messages sent by the current user of forwarded from an unknown chat
|
|
type SavedMessagesTopicTypeMyNotes struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *SavedMessagesTopicTypeMyNotes) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SavedMessagesTopicTypeMyNotes
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SavedMessagesTopicTypeMyNotes) GetClass() string {
|
|
return ClassSavedMessagesTopicType
|
|
}
|
|
|
|
func (*SavedMessagesTopicTypeMyNotes) GetType() string {
|
|
return TypeSavedMessagesTopicTypeMyNotes
|
|
}
|
|
|
|
func (*SavedMessagesTopicTypeMyNotes) SavedMessagesTopicTypeType() string {
|
|
return TypeSavedMessagesTopicTypeMyNotes
|
|
}
|
|
|
|
// Topic containing messages forwarded from a user with hidden privacy
|
|
type SavedMessagesTopicTypeAuthorHidden struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *SavedMessagesTopicTypeAuthorHidden) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SavedMessagesTopicTypeAuthorHidden
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SavedMessagesTopicTypeAuthorHidden) GetClass() string {
|
|
return ClassSavedMessagesTopicType
|
|
}
|
|
|
|
func (*SavedMessagesTopicTypeAuthorHidden) GetType() string {
|
|
return TypeSavedMessagesTopicTypeAuthorHidden
|
|
}
|
|
|
|
func (*SavedMessagesTopicTypeAuthorHidden) SavedMessagesTopicTypeType() string {
|
|
return TypeSavedMessagesTopicTypeAuthorHidden
|
|
}
|
|
|
|
// Topic containing messages forwarded from a specific chat
|
|
type SavedMessagesTopicTypeSavedFromChat struct {
|
|
meta
|
|
// Identifier of the chat
|
|
ChatId int64 `json:"chat_id"`
|
|
}
|
|
|
|
func (entity *SavedMessagesTopicTypeSavedFromChat) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SavedMessagesTopicTypeSavedFromChat
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SavedMessagesTopicTypeSavedFromChat) GetClass() string {
|
|
return ClassSavedMessagesTopicType
|
|
}
|
|
|
|
func (*SavedMessagesTopicTypeSavedFromChat) GetType() string {
|
|
return TypeSavedMessagesTopicTypeSavedFromChat
|
|
}
|
|
|
|
func (*SavedMessagesTopicTypeSavedFromChat) SavedMessagesTopicTypeType() string {
|
|
return TypeSavedMessagesTopicTypeSavedFromChat
|
|
}
|
|
|
|
// Contains information about a Saved Messages topic
|
|
type SavedMessagesTopic struct {
|
|
meta
|
|
// Unique topic identifier
|
|
Id int64 `json:"id"`
|
|
// Type of the topic
|
|
Type SavedMessagesTopicType `json:"type"`
|
|
// True, if the topic is pinned
|
|
IsPinned bool `json:"is_pinned"`
|
|
// A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order
|
|
Order JsonInt64 `json:"order"`
|
|
// Last message in the topic; may be null if none or unknown
|
|
LastMessage *Message `json:"last_message"`
|
|
// A draft of a message in the topic; may be null if none
|
|
DraftMessage *DraftMessage `json:"draft_message"`
|
|
}
|
|
|
|
func (entity *SavedMessagesTopic) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SavedMessagesTopic
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SavedMessagesTopic) GetClass() string {
|
|
return ClassSavedMessagesTopic
|
|
}
|
|
|
|
func (*SavedMessagesTopic) GetType() string {
|
|
return TypeSavedMessagesTopic
|
|
}
|
|
|
|
func (savedMessagesTopic *SavedMessagesTopic) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Id int64 `json:"id"`
|
|
Type json.RawMessage `json:"type"`
|
|
IsPinned bool `json:"is_pinned"`
|
|
Order JsonInt64 `json:"order"`
|
|
LastMessage *Message `json:"last_message"`
|
|
DraftMessage *DraftMessage `json:"draft_message"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
savedMessagesTopic.Id = tmp.Id
|
|
savedMessagesTopic.IsPinned = tmp.IsPinned
|
|
savedMessagesTopic.Order = tmp.Order
|
|
savedMessagesTopic.LastMessage = tmp.LastMessage
|
|
savedMessagesTopic.DraftMessage = tmp.DraftMessage
|
|
|
|
fieldType, _ := UnmarshalSavedMessagesTopicType(tmp.Type)
|
|
savedMessagesTopic.Type = fieldType
|
|
|
|
return nil
|
|
}
|
|
|
|
// 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"`
|
|
// Point in time (Unix timestamp) when 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 if none
|
|
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
|
|
}
|
|
|
|
// Options to be used for generation of a link preview
|
|
type LinkPreviewOptions struct {
|
|
meta
|
|
// True, if link preview must be disabled
|
|
IsDisabled bool `json:"is_disabled"`
|
|
// URL to use for link preview. If empty, then the first URL found in the message text will be used
|
|
Url string `json:"url"`
|
|
// True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified
|
|
ForceSmallMedia bool `json:"force_small_media"`
|
|
// True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified
|
|
ForceLargeMedia bool `json:"force_large_media"`
|
|
// True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats
|
|
ShowAboveText bool `json:"show_above_text"`
|
|
}
|
|
|
|
func (entity *LinkPreviewOptions) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub LinkPreviewOptions
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*LinkPreviewOptions) GetClass() string {
|
|
return ClassLinkPreviewOptions
|
|
}
|
|
|
|
func (*LinkPreviewOptions) GetType() string {
|
|
return TypeLinkPreviewOptions
|
|
}
|
|
|
|
// Contains information about a user shared with a bot
|
|
type SharedUser struct {
|
|
meta
|
|
// User identifier
|
|
UserId int64 `json:"user_id"`
|
|
// First name of the user; for bots only
|
|
FirstName string `json:"first_name"`
|
|
// Last name of the user; for bots only
|
|
LastName string `json:"last_name"`
|
|
// Username of the user; for bots only
|
|
Username string `json:"username"`
|
|
// Profile photo of the user; for bots only; may be null
|
|
Photo *Photo `json:"photo"`
|
|
}
|
|
|
|
func (entity *SharedUser) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SharedUser
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SharedUser) GetClass() string {
|
|
return ClassSharedUser
|
|
}
|
|
|
|
func (*SharedUser) GetType() string {
|
|
return TypeSharedUser
|
|
}
|
|
|
|
// Contains information about a chat shared with a bot
|
|
type SharedChat struct {
|
|
meta
|
|
// Chat identifier
|
|
ChatId int64 `json:"chat_id"`
|
|
// Title of the chat; for bots only
|
|
Title string `json:"title"`
|
|
// Username of the chat; for bots only
|
|
Username string `json:"username"`
|
|
// Photo of the chat; for bots only; may be null
|
|
Photo *Photo `json:"photo"`
|
|
}
|
|
|
|
func (entity *SharedChat) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SharedChat
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SharedChat) GetClass() string {
|
|
return ClassSharedChat
|
|
}
|
|
|
|
func (*SharedChat) GetType() string {
|
|
return TypeSharedChat
|
|
}
|
|
|
|
// 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 {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextPlain) GetType() string {
|
|
return TypeRichTextPlain
|
|
}
|
|
|
|
func (*RichTextPlain) RichTextType() string {
|
|
return TypeRichTextPlain
|
|
}
|
|
|
|
// A bold rich text
|
|
type RichTextBold struct {
|
|
meta
|
|
// Text
|
|
Text RichText `json:"text"`
|
|
}
|
|
|
|
func (entity *RichTextBold) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextBold
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextBold) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextBold) GetType() string {
|
|
return TypeRichTextBold
|
|
}
|
|
|
|
func (*RichTextBold) RichTextType() string {
|
|
return TypeRichTextBold
|
|
}
|
|
|
|
func (richTextBold *RichTextBold) 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)
|
|
richTextBold.Text = fieldText
|
|
|
|
return nil
|
|
}
|
|
|
|
// An italicized rich text
|
|
type RichTextItalic struct {
|
|
meta
|
|
// Text
|
|
Text RichText `json:"text"`
|
|
}
|
|
|
|
func (entity *RichTextItalic) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextItalic
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextItalic) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextItalic) GetType() string {
|
|
return TypeRichTextItalic
|
|
}
|
|
|
|
func (*RichTextItalic) RichTextType() string {
|
|
return TypeRichTextItalic
|
|
}
|
|
|
|
func (richTextItalic *RichTextItalic) 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)
|
|
richTextItalic.Text = fieldText
|
|
|
|
return nil
|
|
}
|
|
|
|
// An underlined rich text
|
|
type RichTextUnderline struct {
|
|
meta
|
|
// Text
|
|
Text RichText `json:"text"`
|
|
}
|
|
|
|
func (entity *RichTextUnderline) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextUnderline
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextUnderline) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextUnderline) GetType() string {
|
|
return TypeRichTextUnderline
|
|
}
|
|
|
|
func (*RichTextUnderline) RichTextType() string {
|
|
return TypeRichTextUnderline
|
|
}
|
|
|
|
func (richTextUnderline *RichTextUnderline) 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)
|
|
richTextUnderline.Text = fieldText
|
|
|
|
return nil
|
|
}
|
|
|
|
// A strikethrough rich text
|
|
type RichTextStrikethrough struct {
|
|
meta
|
|
// Text
|
|
Text RichText `json:"text"`
|
|
}
|
|
|
|
func (entity *RichTextStrikethrough) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextStrikethrough
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextStrikethrough) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextStrikethrough) GetType() string {
|
|
return TypeRichTextStrikethrough
|
|
}
|
|
|
|
func (*RichTextStrikethrough) RichTextType() string {
|
|
return TypeRichTextStrikethrough
|
|
}
|
|
|
|
func (richTextStrikethrough *RichTextStrikethrough) 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)
|
|
richTextStrikethrough.Text = fieldText
|
|
|
|
return nil
|
|
}
|
|
|
|
// A fixed-width rich text
|
|
type RichTextFixed struct {
|
|
meta
|
|
// Text
|
|
Text RichText `json:"text"`
|
|
}
|
|
|
|
func (entity *RichTextFixed) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextFixed
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextFixed) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextFixed) GetType() string {
|
|
return TypeRichTextFixed
|
|
}
|
|
|
|
func (*RichTextFixed) RichTextType() string {
|
|
return TypeRichTextFixed
|
|
}
|
|
|
|
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 {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *RichTextUrl) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextUrl
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextUrl) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextUrl) GetType() string {
|
|
return TypeRichTextUrl
|
|
}
|
|
|
|
func (*RichTextUrl) RichTextType() string {
|
|
return TypeRichTextUrl
|
|
}
|
|
|
|
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 {
|
|
meta
|
|
// Text
|
|
Text RichText `json:"text"`
|
|
// Email address
|
|
EmailAddress string `json:"email_address"`
|
|
}
|
|
|
|
func (entity *RichTextEmailAddress) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextEmailAddress
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextEmailAddress) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextEmailAddress) GetType() string {
|
|
return TypeRichTextEmailAddress
|
|
}
|
|
|
|
func (*RichTextEmailAddress) RichTextType() string {
|
|
return TypeRichTextEmailAddress
|
|
}
|
|
|
|
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 {
|
|
meta
|
|
// Text
|
|
Text RichText `json:"text"`
|
|
}
|
|
|
|
func (entity *RichTextSubscript) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextSubscript
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextSubscript) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextSubscript) GetType() string {
|
|
return TypeRichTextSubscript
|
|
}
|
|
|
|
func (*RichTextSubscript) RichTextType() string {
|
|
return TypeRichTextSubscript
|
|
}
|
|
|
|
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 {
|
|
meta
|
|
// Text
|
|
Text RichText `json:"text"`
|
|
}
|
|
|
|
func (entity *RichTextSuperscript) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextSuperscript
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextSuperscript) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextSuperscript) GetType() string {
|
|
return TypeRichTextSuperscript
|
|
}
|
|
|
|
func (*RichTextSuperscript) RichTextType() string {
|
|
return TypeRichTextSuperscript
|
|
}
|
|
|
|
func (richTextSuperscript *RichTextSuperscript) 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)
|
|
richTextSuperscript.Text = fieldText
|
|
|
|
return nil
|
|
}
|
|
|
|
// A marked rich text
|
|
type RichTextMarked struct {
|
|
meta
|
|
// Text
|
|
Text RichText `json:"text"`
|
|
}
|
|
|
|
func (entity *RichTextMarked) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextMarked
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextMarked) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextMarked) GetType() string {
|
|
return TypeRichTextMarked
|
|
}
|
|
|
|
func (*RichTextMarked) RichTextType() string {
|
|
return TypeRichTextMarked
|
|
}
|
|
|
|
func (richTextMarked *RichTextMarked) 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)
|
|
richTextMarked.Text = fieldText
|
|
|
|
return nil
|
|
}
|
|
|
|
// A rich text phone number
|
|
type RichTextPhoneNumber struct {
|
|
meta
|
|
// Text
|
|
Text RichText `json:"text"`
|
|
// Phone number
|
|
PhoneNumber string `json:"phone_number"`
|
|
}
|
|
|
|
func (entity *RichTextPhoneNumber) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextPhoneNumber
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextPhoneNumber) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextPhoneNumber) GetType() string {
|
|
return TypeRichTextPhoneNumber
|
|
}
|
|
|
|
func (*RichTextPhoneNumber) RichTextType() string {
|
|
return TypeRichTextPhoneNumber
|
|
}
|
|
|
|
func (richTextPhoneNumber *RichTextPhoneNumber) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Text json.RawMessage `json:"text"`
|
|
PhoneNumber string `json:"phone_number"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
richTextPhoneNumber.PhoneNumber = tmp.PhoneNumber
|
|
|
|
fieldText, _ := UnmarshalRichText(tmp.Text)
|
|
richTextPhoneNumber.Text = fieldText
|
|
|
|
return nil
|
|
}
|
|
|
|
// A small image inside the text
|
|
type RichTextIcon struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *RichTextIcon) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextIcon
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextIcon) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextIcon) GetType() string {
|
|
return TypeRichTextIcon
|
|
}
|
|
|
|
func (*RichTextIcon) RichTextType() string {
|
|
return TypeRichTextIcon
|
|
}
|
|
|
|
// A reference to a richTexts object on the same web page
|
|
type RichTextReference struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *RichTextReference) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextReference
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextReference) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextReference) GetType() string {
|
|
return TypeRichTextReference
|
|
}
|
|
|
|
func (*RichTextReference) RichTextType() string {
|
|
return TypeRichTextReference
|
|
}
|
|
|
|
func (richTextReference *RichTextReference) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Text json.RawMessage `json:"text"`
|
|
AnchorName string `json:"anchor_name"`
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
richTextReference.AnchorName = tmp.AnchorName
|
|
richTextReference.Url = tmp.Url
|
|
|
|
fieldText, _ := UnmarshalRichText(tmp.Text)
|
|
richTextReference.Text = fieldText
|
|
|
|
return nil
|
|
}
|
|
|
|
// An anchor
|
|
type RichTextAnchor struct {
|
|
meta
|
|
// Anchor name
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
func (entity *RichTextAnchor) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextAnchor
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextAnchor) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextAnchor) GetType() string {
|
|
return TypeRichTextAnchor
|
|
}
|
|
|
|
func (*RichTextAnchor) RichTextType() string {
|
|
return TypeRichTextAnchor
|
|
}
|
|
|
|
// A link to an anchor on the same web page
|
|
type RichTextAnchorLink struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *RichTextAnchorLink) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTextAnchorLink
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTextAnchorLink) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTextAnchorLink) GetType() string {
|
|
return TypeRichTextAnchorLink
|
|
}
|
|
|
|
func (*RichTextAnchorLink) RichTextType() string {
|
|
return TypeRichTextAnchorLink
|
|
}
|
|
|
|
func (richTextAnchorLink *RichTextAnchorLink) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Text json.RawMessage `json:"text"`
|
|
AnchorName string `json:"anchor_name"`
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
richTextAnchorLink.AnchorName = tmp.AnchorName
|
|
richTextAnchorLink.Url = tmp.Url
|
|
|
|
fieldText, _ := UnmarshalRichText(tmp.Text)
|
|
richTextAnchorLink.Text = fieldText
|
|
|
|
return nil
|
|
}
|
|
|
|
// A concatenation of rich texts
|
|
type RichTexts struct {
|
|
meta
|
|
// Texts
|
|
Texts []RichText `json:"texts"`
|
|
}
|
|
|
|
func (entity *RichTexts) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub RichTexts
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*RichTexts) GetClass() string {
|
|
return ClassRichText
|
|
}
|
|
|
|
func (*RichTexts) GetType() string {
|
|
return TypeRichTexts
|
|
}
|
|
|
|
func (*RichTexts) RichTextType() string {
|
|
return TypeRichTexts
|
|
}
|
|
|
|
func (richTexts *RichTexts) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Texts []json.RawMessage `json:"texts"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fieldTexts, _ := UnmarshalListOfRichText(tmp.Texts)
|
|
richTexts.Texts = fieldTexts
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains a caption of an instant view web page block, consisting of a text and a trailing credit
|
|
type PageBlockCaption struct {
|
|
meta
|
|
// Content of the caption
|
|
Text RichText `json:"text"`
|
|
// Block credit (like HTML tag <cite>)
|
|
Credit RichText `json:"credit"`
|
|
}
|
|
|
|
func (entity *PageBlockCaption) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockCaption
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockCaption) GetClass() string {
|
|
return ClassPageBlockCaption
|
|
}
|
|
|
|
func (*PageBlockCaption) GetType() string {
|
|
return TypePageBlockCaption
|
|
}
|
|
|
|
func (pageBlockCaption *PageBlockCaption) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Text json.RawMessage `json:"text"`
|
|
Credit json.RawMessage `json:"credit"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fieldText, _ := UnmarshalRichText(tmp.Text)
|
|
pageBlockCaption.Text = fieldText
|
|
|
|
fieldCredit, _ := UnmarshalRichText(tmp.Credit)
|
|
pageBlockCaption.Credit = fieldCredit
|
|
|
|
return nil
|
|
}
|
|
|
|
// Describes an item of a list page block
|
|
type PageBlockListItem struct {
|
|
meta
|
|
// Item label
|
|
Label string `json:"label"`
|
|
// Item blocks
|
|
PageBlocks []PageBlock `json:"page_blocks"`
|
|
}
|
|
|
|
func (entity *PageBlockListItem) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockListItem
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockListItem) GetClass() string {
|
|
return ClassPageBlockListItem
|
|
}
|
|
|
|
func (*PageBlockListItem) GetType() string {
|
|
return TypePageBlockListItem
|
|
}
|
|
|
|
func (pageBlockListItem *PageBlockListItem) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Label string `json:"label"`
|
|
PageBlocks []json.RawMessage `json:"page_blocks"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
pageBlockListItem.Label = tmp.Label
|
|
|
|
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
|
|
pageBlockListItem.PageBlocks = fieldPageBlocks
|
|
|
|
return nil
|
|
}
|
|
|
|
// The content must be left-aligned
|
|
type PageBlockHorizontalAlignmentLeft struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PageBlockHorizontalAlignmentLeft) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockHorizontalAlignmentLeft
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockHorizontalAlignmentLeft) GetClass() string {
|
|
return ClassPageBlockHorizontalAlignment
|
|
}
|
|
|
|
func (*PageBlockHorizontalAlignmentLeft) GetType() string {
|
|
return TypePageBlockHorizontalAlignmentLeft
|
|
}
|
|
|
|
func (*PageBlockHorizontalAlignmentLeft) PageBlockHorizontalAlignmentType() string {
|
|
return TypePageBlockHorizontalAlignmentLeft
|
|
}
|
|
|
|
// The content must be center-aligned
|
|
type PageBlockHorizontalAlignmentCenter struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PageBlockHorizontalAlignmentCenter) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockHorizontalAlignmentCenter
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockHorizontalAlignmentCenter) GetClass() string {
|
|
return ClassPageBlockHorizontalAlignment
|
|
}
|
|
|
|
func (*PageBlockHorizontalAlignmentCenter) GetType() string {
|
|
return TypePageBlockHorizontalAlignmentCenter
|
|
}
|
|
|
|
func (*PageBlockHorizontalAlignmentCenter) PageBlockHorizontalAlignmentType() string {
|
|
return TypePageBlockHorizontalAlignmentCenter
|
|
}
|
|
|
|
// The content must be right-aligned
|
|
type PageBlockHorizontalAlignmentRight struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PageBlockHorizontalAlignmentRight) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockHorizontalAlignmentRight
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockHorizontalAlignmentRight) GetClass() string {
|
|
return ClassPageBlockHorizontalAlignment
|
|
}
|
|
|
|
func (*PageBlockHorizontalAlignmentRight) GetType() string {
|
|
return TypePageBlockHorizontalAlignmentRight
|
|
}
|
|
|
|
func (*PageBlockHorizontalAlignmentRight) PageBlockHorizontalAlignmentType() string {
|
|
return TypePageBlockHorizontalAlignmentRight
|
|
}
|
|
|
|
// The content must be top-aligned
|
|
type PageBlockVerticalAlignmentTop struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PageBlockVerticalAlignmentTop) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockVerticalAlignmentTop
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockVerticalAlignmentTop) GetClass() string {
|
|
return ClassPageBlockVerticalAlignment
|
|
}
|
|
|
|
func (*PageBlockVerticalAlignmentTop) GetType() string {
|
|
return TypePageBlockVerticalAlignmentTop
|
|
}
|
|
|
|
func (*PageBlockVerticalAlignmentTop) PageBlockVerticalAlignmentType() string {
|
|
return TypePageBlockVerticalAlignmentTop
|
|
}
|
|
|
|
// The content must be middle-aligned
|
|
type PageBlockVerticalAlignmentMiddle struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PageBlockVerticalAlignmentMiddle) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockVerticalAlignmentMiddle
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockVerticalAlignmentMiddle) GetClass() string {
|
|
return ClassPageBlockVerticalAlignment
|
|
}
|
|
|
|
func (*PageBlockVerticalAlignmentMiddle) GetType() string {
|
|
return TypePageBlockVerticalAlignmentMiddle
|
|
}
|
|
|
|
func (*PageBlockVerticalAlignmentMiddle) PageBlockVerticalAlignmentType() string {
|
|
return TypePageBlockVerticalAlignmentMiddle
|
|
}
|
|
|
|
// The content must be bottom-aligned
|
|
type PageBlockVerticalAlignmentBottom struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PageBlockVerticalAlignmentBottom) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockVerticalAlignmentBottom
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockVerticalAlignmentBottom) GetClass() string {
|
|
return ClassPageBlockVerticalAlignment
|
|
}
|
|
|
|
func (*PageBlockVerticalAlignmentBottom) GetType() string {
|
|
return TypePageBlockVerticalAlignmentBottom
|
|
}
|
|
|
|
func (*PageBlockVerticalAlignmentBottom) PageBlockVerticalAlignmentType() string {
|
|
return TypePageBlockVerticalAlignmentBottom
|
|
}
|
|
|
|
// Represents a cell of a table
|
|
type PageBlockTableCell struct {
|
|
meta
|
|
// Cell text; may be null. If the text is null, then the cell must be invisible
|
|
Text RichText `json:"text"`
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PageBlockTableCell) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockTableCell
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockTableCell) GetClass() string {
|
|
return ClassPageBlockTableCell
|
|
}
|
|
|
|
func (*PageBlockTableCell) GetType() string {
|
|
return TypePageBlockTableCell
|
|
}
|
|
|
|
func (pageBlockTableCell *PageBlockTableCell) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
pageBlockTableCell.IsHeader = tmp.IsHeader
|
|
pageBlockTableCell.Colspan = tmp.Colspan
|
|
pageBlockTableCell.Rowspan = tmp.Rowspan
|
|
|
|
fieldText, _ := UnmarshalRichText(tmp.Text)
|
|
pageBlockTableCell.Text = fieldText
|
|
|
|
fieldAlign, _ := UnmarshalPageBlockHorizontalAlignment(tmp.Align)
|
|
pageBlockTableCell.Align = fieldAlign
|
|
|
|
fieldValign, _ := UnmarshalPageBlockVerticalAlignment(tmp.Valign)
|
|
pageBlockTableCell.Valign = fieldValign
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains information about a related article
|
|
type PageBlockRelatedArticle struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PageBlockRelatedArticle) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockRelatedArticle
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockRelatedArticle) GetClass() string {
|
|
return ClassPageBlockRelatedArticle
|
|
}
|
|
|
|
func (*PageBlockRelatedArticle) GetType() string {
|
|
return TypePageBlockRelatedArticle
|
|
}
|
|
|
|
// The title of a page
|
|
type PageBlockTitle struct {
|
|
meta
|
|
// Title
|
|
Title RichText `json:"title"`
|
|
}
|
|
|
|
func (entity *PageBlockTitle) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockTitle
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockTitle) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockTitle) GetType() string {
|
|
return TypePageBlockTitle
|
|
}
|
|
|
|
func (*PageBlockTitle) PageBlockType() string {
|
|
return TypePageBlockTitle
|
|
}
|
|
|
|
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 {
|
|
meta
|
|
// Subtitle
|
|
Subtitle RichText `json:"subtitle"`
|
|
}
|
|
|
|
func (entity *PageBlockSubtitle) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockSubtitle
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockSubtitle) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockSubtitle) GetType() string {
|
|
return TypePageBlockSubtitle
|
|
}
|
|
|
|
func (*PageBlockSubtitle) PageBlockType() string {
|
|
return TypePageBlockSubtitle
|
|
}
|
|
|
|
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 {
|
|
meta
|
|
// Author
|
|
Author RichText `json:"author"`
|
|
// Point in time (Unix timestamp) when the article was published; 0 if unknown
|
|
PublishDate int32 `json:"publish_date"`
|
|
}
|
|
|
|
func (entity *PageBlockAuthorDate) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockAuthorDate
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockAuthorDate) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockAuthorDate) GetType() string {
|
|
return TypePageBlockAuthorDate
|
|
}
|
|
|
|
func (*PageBlockAuthorDate) PageBlockType() string {
|
|
return TypePageBlockAuthorDate
|
|
}
|
|
|
|
func (pageBlockAuthorDate *PageBlockAuthorDate) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Author json.RawMessage `json:"author"`
|
|
PublishDate int32 `json:"publish_date"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
pageBlockAuthorDate.PublishDate = tmp.PublishDate
|
|
|
|
fieldAuthor, _ := UnmarshalRichText(tmp.Author)
|
|
pageBlockAuthorDate.Author = fieldAuthor
|
|
|
|
return nil
|
|
}
|
|
|
|
// A header
|
|
type PageBlockHeader struct {
|
|
meta
|
|
// Header
|
|
Header RichText `json:"header"`
|
|
}
|
|
|
|
func (entity *PageBlockHeader) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockHeader
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockHeader) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockHeader) GetType() string {
|
|
return TypePageBlockHeader
|
|
}
|
|
|
|
func (*PageBlockHeader) PageBlockType() string {
|
|
return TypePageBlockHeader
|
|
}
|
|
|
|
func (pageBlockHeader *PageBlockHeader) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Header json.RawMessage `json:"header"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fieldHeader, _ := UnmarshalRichText(tmp.Header)
|
|
pageBlockHeader.Header = fieldHeader
|
|
|
|
return nil
|
|
}
|
|
|
|
// A subheader
|
|
type PageBlockSubheader struct {
|
|
meta
|
|
// Subheader
|
|
Subheader RichText `json:"subheader"`
|
|
}
|
|
|
|
func (entity *PageBlockSubheader) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockSubheader
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockSubheader) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockSubheader) GetType() string {
|
|
return TypePageBlockSubheader
|
|
}
|
|
|
|
func (*PageBlockSubheader) PageBlockType() string {
|
|
return TypePageBlockSubheader
|
|
}
|
|
|
|
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 {
|
|
meta
|
|
// Kicker
|
|
Kicker RichText `json:"kicker"`
|
|
}
|
|
|
|
func (entity *PageBlockKicker) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockKicker
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockKicker) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockKicker) GetType() string {
|
|
return TypePageBlockKicker
|
|
}
|
|
|
|
func (*PageBlockKicker) PageBlockType() string {
|
|
return TypePageBlockKicker
|
|
}
|
|
|
|
func (pageBlockKicker *PageBlockKicker) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Kicker json.RawMessage `json:"kicker"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fieldKicker, _ := UnmarshalRichText(tmp.Kicker)
|
|
pageBlockKicker.Kicker = fieldKicker
|
|
|
|
return nil
|
|
}
|
|
|
|
// A text paragraph
|
|
type PageBlockParagraph struct {
|
|
meta
|
|
// Paragraph text
|
|
Text RichText `json:"text"`
|
|
}
|
|
|
|
func (entity *PageBlockParagraph) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockParagraph
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockParagraph) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockParagraph) GetType() string {
|
|
return TypePageBlockParagraph
|
|
}
|
|
|
|
func (*PageBlockParagraph) PageBlockType() string {
|
|
return TypePageBlockParagraph
|
|
}
|
|
|
|
func (pageBlockParagraph *PageBlockParagraph) 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)
|
|
pageBlockParagraph.Text = fieldText
|
|
|
|
return nil
|
|
}
|
|
|
|
// A preformatted text paragraph
|
|
type PageBlockPreformatted struct {
|
|
meta
|
|
// Paragraph text
|
|
Text RichText `json:"text"`
|
|
// Programming language for which the text needs to be formatted
|
|
Language string `json:"language"`
|
|
}
|
|
|
|
func (entity *PageBlockPreformatted) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockPreformatted
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockPreformatted) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockPreformatted) GetType() string {
|
|
return TypePageBlockPreformatted
|
|
}
|
|
|
|
func (*PageBlockPreformatted) PageBlockType() string {
|
|
return TypePageBlockPreformatted
|
|
}
|
|
|
|
func (pageBlockPreformatted *PageBlockPreformatted) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Text json.RawMessage `json:"text"`
|
|
Language string `json:"language"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
pageBlockPreformatted.Language = tmp.Language
|
|
|
|
fieldText, _ := UnmarshalRichText(tmp.Text)
|
|
pageBlockPreformatted.Text = fieldText
|
|
|
|
return nil
|
|
}
|
|
|
|
// The footer of a page
|
|
type PageBlockFooter struct {
|
|
meta
|
|
// Footer
|
|
Footer RichText `json:"footer"`
|
|
}
|
|
|
|
func (entity *PageBlockFooter) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockFooter
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockFooter) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockFooter) GetType() string {
|
|
return TypePageBlockFooter
|
|
}
|
|
|
|
func (*PageBlockFooter) PageBlockType() string {
|
|
return TypePageBlockFooter
|
|
}
|
|
|
|
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{
|
|
meta
|
|
}
|
|
|
|
func (entity *PageBlockDivider) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockDivider
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockDivider) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockDivider) GetType() string {
|
|
return TypePageBlockDivider
|
|
}
|
|
|
|
func (*PageBlockDivider) PageBlockType() string {
|
|
return TypePageBlockDivider
|
|
}
|
|
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PageBlockAnchor) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockAnchor
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockAnchor) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockAnchor) GetType() string {
|
|
return TypePageBlockAnchor
|
|
}
|
|
|
|
func (*PageBlockAnchor) PageBlockType() string {
|
|
return TypePageBlockAnchor
|
|
}
|
|
|
|
// A list of data blocks
|
|
type PageBlockList struct {
|
|
meta
|
|
// The items of the list
|
|
Items []*PageBlockListItem `json:"items"`
|
|
}
|
|
|
|
func (entity *PageBlockList) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockList
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockList) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockList) GetType() string {
|
|
return TypePageBlockList
|
|
}
|
|
|
|
func (*PageBlockList) PageBlockType() string {
|
|
return TypePageBlockList
|
|
}
|
|
|
|
// 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 {
|
|
var tmp struct {
|
|
Text json.RawMessage `json:"text"`
|
|
Credit json.RawMessage `json:"credit"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fieldText, _ := UnmarshalRichText(tmp.Text)
|
|
pageBlockBlockQuote.Text = fieldText
|
|
|
|
fieldCredit, _ := UnmarshalRichText(tmp.Credit)
|
|
pageBlockBlockQuote.Credit = fieldCredit
|
|
|
|
return nil
|
|
}
|
|
|
|
// A pull quote
|
|
type PageBlockPullQuote struct {
|
|
meta
|
|
// Quote text
|
|
Text RichText `json:"text"`
|
|
// Quote credit
|
|
Credit RichText `json:"credit"`
|
|
}
|
|
|
|
func (entity *PageBlockPullQuote) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockPullQuote
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockPullQuote) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockPullQuote) GetType() string {
|
|
return TypePageBlockPullQuote
|
|
}
|
|
|
|
func (*PageBlockPullQuote) PageBlockType() string {
|
|
return TypePageBlockPullQuote
|
|
}
|
|
|
|
func (pageBlockPullQuote *PageBlockPullQuote) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Text json.RawMessage `json:"text"`
|
|
Credit json.RawMessage `json:"credit"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fieldText, _ := UnmarshalRichText(tmp.Text)
|
|
pageBlockPullQuote.Text = fieldText
|
|
|
|
fieldCredit, _ := UnmarshalRichText(tmp.Credit)
|
|
pageBlockPullQuote.Credit = fieldCredit
|
|
|
|
return nil
|
|
}
|
|
|
|
// An animation
|
|
type PageBlockAnimation struct {
|
|
meta
|
|
// Animation file; may be null
|
|
Animation *Animation `json:"animation"`
|
|
// Animation caption
|
|
Caption *PageBlockCaption `json:"caption"`
|
|
// True, if the animation must be played automatically
|
|
NeedAutoplay bool `json:"need_autoplay"`
|
|
}
|
|
|
|
func (entity *PageBlockAnimation) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockAnimation
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockAnimation) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockAnimation) GetType() string {
|
|
return TypePageBlockAnimation
|
|
}
|
|
|
|
func (*PageBlockAnimation) PageBlockType() string {
|
|
return TypePageBlockAnimation
|
|
}
|
|
|
|
// An audio file
|
|
type PageBlockAudio struct {
|
|
meta
|
|
// Audio file; may be null
|
|
Audio *Audio `json:"audio"`
|
|
// Audio file caption
|
|
Caption *PageBlockCaption `json:"caption"`
|
|
}
|
|
|
|
func (entity *PageBlockAudio) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockAudio
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockAudio) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockAudio) GetType() string {
|
|
return TypePageBlockAudio
|
|
}
|
|
|
|
func (*PageBlockAudio) PageBlockType() string {
|
|
return TypePageBlockAudio
|
|
}
|
|
|
|
// A photo
|
|
type PageBlockPhoto struct {
|
|
meta
|
|
// Photo file; may be null
|
|
Photo *Photo `json:"photo"`
|
|
// Photo caption
|
|
Caption *PageBlockCaption `json:"caption"`
|
|
// URL that needs to be opened when the photo is clicked
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
func (entity *PageBlockPhoto) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockPhoto
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockPhoto) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockPhoto) GetType() string {
|
|
return TypePageBlockPhoto
|
|
}
|
|
|
|
func (*PageBlockPhoto) PageBlockType() string {
|
|
return TypePageBlockPhoto
|
|
}
|
|
|
|
// A video
|
|
type PageBlockVideo struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PageBlockVideo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockVideo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockVideo) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockVideo) GetType() string {
|
|
return TypePageBlockVideo
|
|
}
|
|
|
|
func (*PageBlockVideo) PageBlockType() string {
|
|
return TypePageBlockVideo
|
|
}
|
|
|
|
// A voice note
|
|
type PageBlockVoiceNote struct {
|
|
meta
|
|
// Voice note; may be null
|
|
VoiceNote *VoiceNote `json:"voice_note"`
|
|
// Voice note caption
|
|
Caption *PageBlockCaption `json:"caption"`
|
|
}
|
|
|
|
func (entity *PageBlockVoiceNote) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockVoiceNote
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockVoiceNote) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockVoiceNote) GetType() string {
|
|
return TypePageBlockVoiceNote
|
|
}
|
|
|
|
func (*PageBlockVoiceNote) PageBlockType() string {
|
|
return TypePageBlockVoiceNote
|
|
}
|
|
|
|
// A page cover
|
|
type PageBlockCover struct {
|
|
meta
|
|
// Cover
|
|
Cover PageBlock `json:"cover"`
|
|
}
|
|
|
|
func (entity *PageBlockCover) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockCover
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockCover) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockCover) GetType() string {
|
|
return TypePageBlockCover
|
|
}
|
|
|
|
func (*PageBlockCover) PageBlockType() string {
|
|
return TypePageBlockCover
|
|
}
|
|
|
|
func (pageBlockCover *PageBlockCover) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Cover json.RawMessage `json:"cover"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fieldCover, _ := UnmarshalPageBlock(tmp.Cover)
|
|
pageBlockCover.Cover = fieldCover
|
|
|
|
return nil
|
|
}
|
|
|
|
// An embedded web page
|
|
type PageBlockEmbedded struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PageBlockEmbedded) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockEmbedded
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockEmbedded) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockEmbedded) GetType() string {
|
|
return TypePageBlockEmbedded
|
|
}
|
|
|
|
func (*PageBlockEmbedded) PageBlockType() string {
|
|
return TypePageBlockEmbedded
|
|
}
|
|
|
|
// An embedded post
|
|
type PageBlockEmbeddedPost struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PageBlockEmbeddedPost) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockEmbeddedPost
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockEmbeddedPost) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockEmbeddedPost) GetType() string {
|
|
return TypePageBlockEmbeddedPost
|
|
}
|
|
|
|
func (*PageBlockEmbeddedPost) PageBlockType() string {
|
|
return TypePageBlockEmbeddedPost
|
|
}
|
|
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
pageBlockEmbeddedPost.Url = tmp.Url
|
|
pageBlockEmbeddedPost.Author = tmp.Author
|
|
pageBlockEmbeddedPost.AuthorPhoto = tmp.AuthorPhoto
|
|
pageBlockEmbeddedPost.Date = tmp.Date
|
|
pageBlockEmbeddedPost.Caption = tmp.Caption
|
|
|
|
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
|
|
pageBlockEmbeddedPost.PageBlocks = fieldPageBlocks
|
|
|
|
return nil
|
|
}
|
|
|
|
// A collage
|
|
type PageBlockCollage struct {
|
|
meta
|
|
// Collage item contents
|
|
PageBlocks []PageBlock `json:"page_blocks"`
|
|
// Block caption
|
|
Caption *PageBlockCaption `json:"caption"`
|
|
}
|
|
|
|
func (entity *PageBlockCollage) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockCollage
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockCollage) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockCollage) GetType() string {
|
|
return TypePageBlockCollage
|
|
}
|
|
|
|
func (*PageBlockCollage) PageBlockType() string {
|
|
return TypePageBlockCollage
|
|
}
|
|
|
|
func (pageBlockCollage *PageBlockCollage) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
PageBlocks []json.RawMessage `json:"page_blocks"`
|
|
Caption *PageBlockCaption `json:"caption"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
pageBlockCollage.Caption = tmp.Caption
|
|
|
|
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
|
|
pageBlockCollage.PageBlocks = fieldPageBlocks
|
|
|
|
return nil
|
|
}
|
|
|
|
// A slideshow
|
|
type PageBlockSlideshow struct {
|
|
meta
|
|
// Slideshow item contents
|
|
PageBlocks []PageBlock `json:"page_blocks"`
|
|
// Block caption
|
|
Caption *PageBlockCaption `json:"caption"`
|
|
}
|
|
|
|
func (entity *PageBlockSlideshow) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockSlideshow
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockSlideshow) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockSlideshow) GetType() string {
|
|
return TypePageBlockSlideshow
|
|
}
|
|
|
|
func (*PageBlockSlideshow) PageBlockType() string {
|
|
return TypePageBlockSlideshow
|
|
}
|
|
|
|
func (pageBlockSlideshow *PageBlockSlideshow) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
PageBlocks []json.RawMessage `json:"page_blocks"`
|
|
Caption *PageBlockCaption `json:"caption"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
pageBlockSlideshow.Caption = tmp.Caption
|
|
|
|
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
|
|
pageBlockSlideshow.PageBlocks = fieldPageBlocks
|
|
|
|
return nil
|
|
}
|
|
|
|
// A link to a chat
|
|
type PageBlockChatLink struct {
|
|
meta
|
|
// Chat title
|
|
Title string `json:"title"`
|
|
// Chat photo; may be null
|
|
Photo *ChatPhotoInfo `json:"photo"`
|
|
// Identifier of the accent color for chat title and background of chat photo
|
|
AccentColorId int32 `json:"accent_color_id"`
|
|
// Chat username by which all other information about the chat can be resolved
|
|
Username string `json:"username"`
|
|
}
|
|
|
|
func (entity *PageBlockChatLink) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockChatLink
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockChatLink) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockChatLink) GetType() string {
|
|
return TypePageBlockChatLink
|
|
}
|
|
|
|
func (*PageBlockChatLink) PageBlockType() string {
|
|
return TypePageBlockChatLink
|
|
}
|
|
|
|
// A table
|
|
type PageBlockTable struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PageBlockTable) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockTable
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockTable) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockTable) GetType() string {
|
|
return TypePageBlockTable
|
|
}
|
|
|
|
func (*PageBlockTable) PageBlockType() string {
|
|
return TypePageBlockTable
|
|
}
|
|
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
pageBlockTable.Cells = tmp.Cells
|
|
pageBlockTable.IsBordered = tmp.IsBordered
|
|
pageBlockTable.IsStriped = tmp.IsStriped
|
|
|
|
fieldCaption, _ := UnmarshalRichText(tmp.Caption)
|
|
pageBlockTable.Caption = fieldCaption
|
|
|
|
return nil
|
|
}
|
|
|
|
// A collapsible block
|
|
type PageBlockDetails struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PageBlockDetails) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockDetails
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockDetails) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockDetails) GetType() string {
|
|
return TypePageBlockDetails
|
|
}
|
|
|
|
func (*PageBlockDetails) PageBlockType() string {
|
|
return TypePageBlockDetails
|
|
}
|
|
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
pageBlockDetails.IsOpen = tmp.IsOpen
|
|
|
|
fieldHeader, _ := UnmarshalRichText(tmp.Header)
|
|
pageBlockDetails.Header = fieldHeader
|
|
|
|
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
|
|
pageBlockDetails.PageBlocks = fieldPageBlocks
|
|
|
|
return nil
|
|
}
|
|
|
|
// Related articles
|
|
type PageBlockRelatedArticles struct {
|
|
meta
|
|
// Block header
|
|
Header RichText `json:"header"`
|
|
// List of related articles
|
|
Articles []*PageBlockRelatedArticle `json:"articles"`
|
|
}
|
|
|
|
func (entity *PageBlockRelatedArticles) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockRelatedArticles
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockRelatedArticles) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockRelatedArticles) GetType() string {
|
|
return TypePageBlockRelatedArticles
|
|
}
|
|
|
|
func (*PageBlockRelatedArticles) PageBlockType() string {
|
|
return TypePageBlockRelatedArticles
|
|
}
|
|
|
|
func (pageBlockRelatedArticles *PageBlockRelatedArticles) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Header json.RawMessage `json:"header"`
|
|
Articles []*PageBlockRelatedArticle `json:"articles"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
pageBlockRelatedArticles.Articles = tmp.Articles
|
|
|
|
fieldHeader, _ := UnmarshalRichText(tmp.Header)
|
|
pageBlockRelatedArticles.Header = fieldHeader
|
|
|
|
return nil
|
|
}
|
|
|
|
// A map
|
|
type PageBlockMap struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PageBlockMap) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PageBlockMap
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PageBlockMap) GetClass() string {
|
|
return ClassPageBlock
|
|
}
|
|
|
|
func (*PageBlockMap) GetType() string {
|
|
return TypePageBlockMap
|
|
}
|
|
|
|
func (*PageBlockMap) PageBlockType() string {
|
|
return TypePageBlockMap
|
|
}
|
|
|
|
// Describes an instant view page for a web page
|
|
type WebPageInstantView struct {
|
|
meta
|
|
// Content of the web page
|
|
PageBlocks []PageBlock `json:"page_blocks"`
|
|
// Number of the instant view views; 0 if unknown
|
|
ViewCount int32 `json:"view_count"`
|
|
// Version of the instant view; currently, can be 1 or 2
|
|
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"`
|
|
}
|
|
|
|
func (entity *WebPageInstantView) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub WebPageInstantView
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*WebPageInstantView) GetClass() string {
|
|
return ClassWebPageInstantView
|
|
}
|
|
|
|
func (*WebPageInstantView) GetType() string {
|
|
return TypeWebPageInstantView
|
|
}
|
|
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
webPageInstantView.ViewCount = tmp.ViewCount
|
|
webPageInstantView.Version = tmp.Version
|
|
webPageInstantView.IsRtl = tmp.IsRtl
|
|
webPageInstantView.IsFull = tmp.IsFull
|
|
|
|
fieldPageBlocks, _ := UnmarshalListOfPageBlock(tmp.PageBlocks)
|
|
webPageInstantView.PageBlocks = fieldPageBlocks
|
|
|
|
fieldFeedbackLink, _ := UnmarshalInternalLinkType(tmp.FeedbackLink)
|
|
webPageInstantView.FeedbackLink = fieldFeedbackLink
|
|
|
|
return nil
|
|
}
|
|
|
|
// Describes a link preview
|
|
type WebPage struct {
|
|
meta
|
|
// 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"`
|
|
// True, if size of media in the preview can be changed
|
|
HasLargeMedia bool `json:"has_large_media"`
|
|
// True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos
|
|
ShowLargeMedia bool `json:"show_large_media"`
|
|
// True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear
|
|
SkipConfirmation bool `json:"skip_confirmation"`
|
|
// True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text
|
|
ShowAboveText bool `json:"show_above_text"`
|
|
// 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"`
|
|
// Preview of the content as a document, if available; may be null
|
|
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"`
|
|
// The identifier of the sender of the previewed story; 0 if none
|
|
StorySenderChatId int64 `json:"story_sender_chat_id"`
|
|
// The identifier of the previewed story; 0 if none
|
|
StoryId int32 `json:"story_id"`
|
|
// Version of web page instant view (currently, can be 1 or 2); 0 if none
|
|
InstantViewVersion int32 `json:"instant_view_version"`
|
|
}
|
|
|
|
func (entity *WebPage) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub WebPage
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*WebPage) GetClass() string {
|
|
return ClassWebPage
|
|
}
|
|
|
|
func (*WebPage) GetType() string {
|
|
return TypeWebPage
|
|
}
|
|
|
|
// Contains information about a country
|
|
type CountryInfo struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *CountryInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub CountryInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*CountryInfo) GetClass() string {
|
|
return ClassCountryInfo
|
|
}
|
|
|
|
func (*CountryInfo) GetType() string {
|
|
return TypeCountryInfo
|
|
}
|
|
|
|
// Contains information about countries
|
|
type Countries struct {
|
|
meta
|
|
// The list of countries
|
|
Countries []*CountryInfo `json:"countries"`
|
|
}
|
|
|
|
func (entity *Countries) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub Countries
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*Countries) GetClass() string {
|
|
return ClassCountries
|
|
}
|
|
|
|
func (*Countries) GetType() string {
|
|
return TypeCountries
|
|
}
|
|
|
|
// Contains information about a phone number
|
|
type PhoneNumberInfo struct {
|
|
meta
|
|
// 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"`
|
|
// True, if the phone number was bought at https://fragment.com and isn't tied to a SIM card. Information about the phone number can be received using getCollectibleItemInfo
|
|
IsAnonymous bool `json:"is_anonymous"`
|
|
}
|
|
|
|
func (entity *PhoneNumberInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PhoneNumberInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PhoneNumberInfo) GetClass() string {
|
|
return ClassPhoneNumberInfo
|
|
}
|
|
|
|
func (*PhoneNumberInfo) GetType() string {
|
|
return TypePhoneNumberInfo
|
|
}
|
|
|
|
// A username
|
|
type CollectibleItemTypeUsername struct {
|
|
meta
|
|
// The username
|
|
Username string `json:"username"`
|
|
}
|
|
|
|
func (entity *CollectibleItemTypeUsername) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub CollectibleItemTypeUsername
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*CollectibleItemTypeUsername) GetClass() string {
|
|
return ClassCollectibleItemType
|
|
}
|
|
|
|
func (*CollectibleItemTypeUsername) GetType() string {
|
|
return TypeCollectibleItemTypeUsername
|
|
}
|
|
|
|
func (*CollectibleItemTypeUsername) CollectibleItemTypeType() string {
|
|
return TypeCollectibleItemTypeUsername
|
|
}
|
|
|
|
// A phone number
|
|
type CollectibleItemTypePhoneNumber struct {
|
|
meta
|
|
// The phone number
|
|
PhoneNumber string `json:"phone_number"`
|
|
}
|
|
|
|
func (entity *CollectibleItemTypePhoneNumber) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub CollectibleItemTypePhoneNumber
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*CollectibleItemTypePhoneNumber) GetClass() string {
|
|
return ClassCollectibleItemType
|
|
}
|
|
|
|
func (*CollectibleItemTypePhoneNumber) GetType() string {
|
|
return TypeCollectibleItemTypePhoneNumber
|
|
}
|
|
|
|
func (*CollectibleItemTypePhoneNumber) CollectibleItemTypeType() string {
|
|
return TypeCollectibleItemTypePhoneNumber
|
|
}
|
|
|
|
// Contains information about a collectible item and its last purchase
|
|
type CollectibleItemInfo struct {
|
|
meta
|
|
// Point in time (Unix timestamp) when the item was purchased
|
|
PurchaseDate int32 `json:"purchase_date"`
|
|
// Currency for the paid amount
|
|
Currency string `json:"currency"`
|
|
// The paid amount, in the smallest units of the currency
|
|
Amount int64 `json:"amount"`
|
|
// Cryptocurrency used to pay for the item
|
|
Cryptocurrency string `json:"cryptocurrency"`
|
|
// The paid amount, in the smallest units of the cryptocurrency
|
|
CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"`
|
|
// Individual URL for the item on https://fragment.com
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
func (entity *CollectibleItemInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub CollectibleItemInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*CollectibleItemInfo) GetClass() string {
|
|
return ClassCollectibleItemInfo
|
|
}
|
|
|
|
func (*CollectibleItemInfo) GetType() string {
|
|
return TypeCollectibleItemInfo
|
|
}
|
|
|
|
// Describes an action associated with a bank card number
|
|
type BankCardActionOpenUrl struct {
|
|
meta
|
|
// Action text
|
|
Text string `json:"text"`
|
|
// The URL to be opened
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
func (entity *BankCardActionOpenUrl) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BankCardActionOpenUrl
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BankCardActionOpenUrl) GetClass() string {
|
|
return ClassBankCardActionOpenUrl
|
|
}
|
|
|
|
func (*BankCardActionOpenUrl) GetType() string {
|
|
return TypeBankCardActionOpenUrl
|
|
}
|
|
|
|
// Information about a bank card
|
|
type BankCardInfo struct {
|
|
meta
|
|
// Title of the bank card description
|
|
Title string `json:"title"`
|
|
// Actions that can be done with the bank card number
|
|
Actions []*BankCardActionOpenUrl `json:"actions"`
|
|
}
|
|
|
|
func (entity *BankCardInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub BankCardInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*BankCardInfo) GetClass() string {
|
|
return ClassBankCardInfo
|
|
}
|
|
|
|
func (*BankCardInfo) GetType() string {
|
|
return TypeBankCardInfo
|
|
}
|
|
|
|
// Describes an address
|
|
type Address struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *Address) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub Address
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*Address) GetClass() string {
|
|
return ClassAddress
|
|
}
|
|
|
|
func (*Address) GetType() string {
|
|
return TypeAddress
|
|
}
|
|
|
|
// 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 the header background in the RGB24 format
|
|
HeaderBackgroundColor int32 `json:"header_background_color"`
|
|
// A color of the section background in the RGB24 format
|
|
SectionBackgroundColor int32 `json:"section_background_color"`
|
|
// A color of text in the RGB24 format
|
|
TextColor int32 `json:"text_color"`
|
|
// An accent color of the text in the RGB24 format
|
|
AccentTextColor int32 `json:"accent_text_color"`
|
|
// A color of text on the section headers in the RGB24 format
|
|
SectionHeaderTextColor int32 `json:"section_header_text_color"`
|
|
// A color of the subtitle text in the RGB24 format
|
|
SubtitleTextColor int32 `json:"subtitle_text_color"`
|
|
// A color of the text for destructive actions in the RGB24 format
|
|
DestructiveTextColor int32 `json:"destructive_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
|
|
}
|
|
|
|
// Portion of the price of a product (e.g., "delivery cost", "tax amount")
|
|
type LabeledPricePart struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *LabeledPricePart) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub LabeledPricePart
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*LabeledPricePart) GetClass() string {
|
|
return ClassLabeledPricePart
|
|
}
|
|
|
|
func (*LabeledPricePart) GetType() string {
|
|
return TypeLabeledPricePart
|
|
}
|
|
|
|
// Product invoice
|
|
type Invoice struct {
|
|
meta
|
|
// 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"`
|
|
// 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"`
|
|
// An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay
|
|
TermsOfServiceUrl string `json:"terms_of_service_url"`
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *Invoice) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub Invoice
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*Invoice) GetClass() string {
|
|
return ClassInvoice
|
|
}
|
|
|
|
func (*Invoice) GetType() string {
|
|
return TypeInvoice
|
|
}
|
|
|
|
// Order information
|
|
type OrderInfo struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *OrderInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub OrderInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*OrderInfo) GetClass() string {
|
|
return ClassOrderInfo
|
|
}
|
|
|
|
func (*OrderInfo) GetType() string {
|
|
return TypeOrderInfo
|
|
}
|
|
|
|
// One shipping option
|
|
type ShippingOption struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *ShippingOption) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ShippingOption
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ShippingOption) GetClass() string {
|
|
return ClassShippingOption
|
|
}
|
|
|
|
func (*ShippingOption) GetType() string {
|
|
return TypeShippingOption
|
|
}
|
|
|
|
// Contains information about saved payment credentials
|
|
type SavedCredentials struct {
|
|
meta
|
|
// Unique identifier of the saved credentials
|
|
Id string `json:"id"`
|
|
// Title of the saved credentials
|
|
Title string `json:"title"`
|
|
}
|
|
|
|
func (entity *SavedCredentials) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub SavedCredentials
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*SavedCredentials) GetClass() string {
|
|
return ClassSavedCredentials
|
|
}
|
|
|
|
func (*SavedCredentials) GetType() string {
|
|
return TypeSavedCredentials
|
|
}
|
|
|
|
// 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 {
|
|
meta
|
|
// Identifier of the saved credentials
|
|
SavedCredentialsId string `json:"saved_credentials_id"`
|
|
}
|
|
|
|
func (entity *InputCredentialsSaved) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputCredentialsSaved
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputCredentialsSaved) GetClass() string {
|
|
return ClassInputCredentials
|
|
}
|
|
|
|
func (*InputCredentialsSaved) GetType() string {
|
|
return TypeInputCredentialsSaved
|
|
}
|
|
|
|
func (*InputCredentialsSaved) InputCredentialsType() string {
|
|
return TypeInputCredentialsSaved
|
|
}
|
|
|
|
// Applies if a user enters new credentials on a payment provider website
|
|
type InputCredentialsNew struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *InputCredentialsNew) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputCredentialsNew
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputCredentialsNew) GetClass() string {
|
|
return ClassInputCredentials
|
|
}
|
|
|
|
func (*InputCredentialsNew) GetType() string {
|
|
return TypeInputCredentialsNew
|
|
}
|
|
|
|
func (*InputCredentialsNew) InputCredentialsType() string {
|
|
return TypeInputCredentialsNew
|
|
}
|
|
|
|
// Applies if a user enters new credentials using Apple Pay
|
|
type InputCredentialsApplePay struct {
|
|
meta
|
|
// JSON-encoded data with the credential identifier
|
|
Data string `json:"data"`
|
|
}
|
|
|
|
func (entity *InputCredentialsApplePay) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputCredentialsApplePay
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputCredentialsApplePay) GetClass() string {
|
|
return ClassInputCredentials
|
|
}
|
|
|
|
func (*InputCredentialsApplePay) GetType() string {
|
|
return TypeInputCredentialsApplePay
|
|
}
|
|
|
|
func (*InputCredentialsApplePay) InputCredentialsType() string {
|
|
return TypeInputCredentialsApplePay
|
|
}
|
|
|
|
// Applies if a user enters new credentials using Google Pay
|
|
type InputCredentialsGooglePay struct {
|
|
meta
|
|
// JSON-encoded data with the credential identifier
|
|
Data string `json:"data"`
|
|
}
|
|
|
|
func (entity *InputCredentialsGooglePay) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputCredentialsGooglePay
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputCredentialsGooglePay) GetClass() string {
|
|
return ClassInputCredentials
|
|
}
|
|
|
|
func (*InputCredentialsGooglePay) GetType() string {
|
|
return TypeInputCredentialsGooglePay
|
|
}
|
|
|
|
func (*InputCredentialsGooglePay) InputCredentialsType() string {
|
|
return TypeInputCredentialsGooglePay
|
|
}
|
|
|
|
// Smart Glocal payment provider
|
|
type PaymentProviderSmartGlocal struct {
|
|
meta
|
|
// Public payment token
|
|
PublicToken string `json:"public_token"`
|
|
// URL for sending card tokenization requests
|
|
TokenizeUrl string `json:"tokenize_url"`
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// Stripe payment provider
|
|
type PaymentProviderStripe struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PaymentProviderStripe) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PaymentProviderStripe
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PaymentProviderStripe) GetClass() string {
|
|
return ClassPaymentProvider
|
|
}
|
|
|
|
func (*PaymentProviderStripe) GetType() string {
|
|
return TypePaymentProviderStripe
|
|
}
|
|
|
|
func (*PaymentProviderStripe) PaymentProviderType() string {
|
|
return TypePaymentProviderStripe
|
|
}
|
|
|
|
// Some other payment provider, for which a web payment form must be shown
|
|
type PaymentProviderOther struct {
|
|
meta
|
|
// 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
|
|
}
|
|
|
|
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) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PaymentOption
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PaymentOption) GetClass() string {
|
|
return ClassPaymentOption
|
|
}
|
|
|
|
func (*PaymentOption) GetType() string {
|
|
return TypePaymentOption
|
|
}
|
|
|
|
// Contains information about an invoice payment form
|
|
type PaymentForm struct {
|
|
meta
|
|
// The payment form identifier
|
|
Id JsonInt64 `json:"id"`
|
|
// Full information about the invoice
|
|
Invoice *Invoice `json:"invoice"`
|
|
// User identifier of the seller bot
|
|
SellerBotUserId int64 `json:"seller_bot_user_id"`
|
|
// User identifier of the payment provider bot
|
|
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"`
|
|
// Saved server-side order information; may be null
|
|
SavedOrderInfo *OrderInfo `json:"saved_order_info"`
|
|
// The list of saved payment credentials
|
|
SavedCredentials []*SavedCredentials `json:"saved_credentials"`
|
|
// True, if the user can choose to save credentials
|
|
CanSaveCredentials bool `json:"can_save_credentials"`
|
|
// True, if the user will be able to save credentials, if sets up a 2-step verification password
|
|
NeedPassword bool `json:"need_password"`
|
|
// Product title
|
|
ProductTitle string `json:"product_title"`
|
|
// Product description
|
|
ProductDescription *FormattedText `json:"product_description"`
|
|
// Product photo; may be null
|
|
ProductPhoto *Photo `json:"product_photo"`
|
|
}
|
|
|
|
func (entity *PaymentForm) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PaymentForm
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PaymentForm) GetClass() string {
|
|
return ClassPaymentForm
|
|
}
|
|
|
|
func (*PaymentForm) GetType() string {
|
|
return TypePaymentForm
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options
|
|
type ValidatedOrderInfo struct {
|
|
meta
|
|
// Temporary identifier of the order information
|
|
OrderInfoId string `json:"order_info_id"`
|
|
// Available shipping options
|
|
ShippingOptions []*ShippingOption `json:"shipping_options"`
|
|
}
|
|
|
|
func (entity *ValidatedOrderInfo) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub ValidatedOrderInfo
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*ValidatedOrderInfo) GetClass() string {
|
|
return ClassValidatedOrderInfo
|
|
}
|
|
|
|
func (*ValidatedOrderInfo) GetType() string {
|
|
return TypeValidatedOrderInfo
|
|
}
|
|
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PaymentResult) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PaymentResult
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PaymentResult) GetClass() string {
|
|
return ClassPaymentResult
|
|
}
|
|
|
|
func (*PaymentResult) GetType() string {
|
|
return TypePaymentResult
|
|
}
|
|
|
|
// Contains information about a successful payment
|
|
type PaymentReceipt struct {
|
|
meta
|
|
// Product title
|
|
Title string `json:"title"`
|
|
// Product description
|
|
Description *FormattedText `json:"description"`
|
|
// 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
|
|
PaymentProviderUserId int64 `json:"payment_provider_user_id"`
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PaymentReceipt) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PaymentReceipt
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PaymentReceipt) GetClass() string {
|
|
return ClassPaymentReceipt
|
|
}
|
|
|
|
func (*PaymentReceipt) GetType() string {
|
|
return TypePaymentReceipt
|
|
}
|
|
|
|
// An invoice from a message of the type messageInvoice
|
|
type InputInvoiceMessage struct {
|
|
meta
|
|
// Chat identifier of the message
|
|
ChatId int64 `json:"chat_id"`
|
|
// Message identifier
|
|
MessageId int64 `json:"message_id"`
|
|
}
|
|
|
|
func (entity *InputInvoiceMessage) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputInvoiceMessage
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputInvoiceMessage) GetClass() string {
|
|
return ClassInputInvoice
|
|
}
|
|
|
|
func (*InputInvoiceMessage) GetType() string {
|
|
return TypeInputInvoiceMessage
|
|
}
|
|
|
|
func (*InputInvoiceMessage) InputInvoiceType() string {
|
|
return TypeInputInvoiceMessage
|
|
}
|
|
|
|
// An invoice from a link of the type internalLinkTypeInvoice
|
|
type InputInvoiceName struct {
|
|
meta
|
|
// Name of the invoice
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
func (entity *InputInvoiceName) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputInvoiceName
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputInvoiceName) GetClass() string {
|
|
return ClassInputInvoice
|
|
}
|
|
|
|
func (*InputInvoiceName) GetType() string {
|
|
return TypeInputInvoiceName
|
|
}
|
|
|
|
func (*InputInvoiceName) InputInvoiceType() string {
|
|
return TypeInputInvoiceName
|
|
}
|
|
|
|
// An invoice for a payment toward Telegram; must not be used in the in-store apps
|
|
type InputInvoiceTelegram struct {
|
|
meta
|
|
// Transaction purpose
|
|
Purpose TelegramPaymentPurpose `json:"purpose"`
|
|
}
|
|
|
|
func (entity *InputInvoiceTelegram) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputInvoiceTelegram
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputInvoiceTelegram) GetClass() string {
|
|
return ClassInputInvoice
|
|
}
|
|
|
|
func (*InputInvoiceTelegram) GetType() string {
|
|
return TypeInputInvoiceTelegram
|
|
}
|
|
|
|
func (*InputInvoiceTelegram) InputInvoiceType() string {
|
|
return TypeInputInvoiceTelegram
|
|
}
|
|
|
|
func (inputInvoiceTelegram *InputInvoiceTelegram) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Purpose json.RawMessage `json:"purpose"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fieldPurpose, _ := UnmarshalTelegramPaymentPurpose(tmp.Purpose)
|
|
inputInvoiceTelegram.Purpose = fieldPurpose
|
|
|
|
return nil
|
|
}
|
|
|
|
// 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, in seconds; 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 unsupported
|
|
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
|
|
}
|
|
|
|
// Describes parameters of a Telegram Premium giveaway
|
|
type PremiumGiveawayParameters struct {
|
|
meta
|
|
// Identifier of the supergroup or channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription. If the chat is a channel, then can_post_messages right is required in the channel, otherwise, the user must be an administrator in the supergroup
|
|
BoostedChatId int64 `json:"boosted_chat_id"`
|
|
// Identifiers of other supergroup or channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats
|
|
AdditionalChatIds []int64 `json:"additional_chat_ids"`
|
|
// Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways
|
|
WinnersSelectionDate int32 `json:"winners_selection_date"`
|
|
// True, if only new members of the chats will be eligible for the giveaway
|
|
OnlyNewMembers bool `json:"only_new_members"`
|
|
// True, if the list of winners of the giveaway will be available to everyone
|
|
HasPublicWinners bool `json:"has_public_winners"`
|
|
// The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought at https://fragment.com can participate in any giveaway and the country code "FT" must not be specified in the list
|
|
CountryCodes []string `json:"country_codes"`
|
|
// Additional description of the giveaway prize; 0-128 characters
|
|
PrizeDescription string `json:"prize_description"`
|
|
}
|
|
|
|
func (entity *PremiumGiveawayParameters) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PremiumGiveawayParameters
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PremiumGiveawayParameters) GetClass() string {
|
|
return ClassPremiumGiveawayParameters
|
|
}
|
|
|
|
func (*PremiumGiveawayParameters) GetType() string {
|
|
return TypePremiumGiveawayParameters
|
|
}
|
|
|
|
// 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
|
|
type PassportElementTypePassport struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypePassport) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypePassport
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypePassport) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypePassport) GetType() string {
|
|
return TypePassportElementTypePassport
|
|
}
|
|
|
|
func (*PassportElementTypePassport) PassportElementTypeType() string {
|
|
return TypePassportElementTypePassport
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's driver license
|
|
type PassportElementTypeDriverLicense struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypeDriverLicense) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypeDriverLicense
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypeDriverLicense) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypeDriverLicense) GetType() string {
|
|
return TypePassportElementTypeDriverLicense
|
|
}
|
|
|
|
func (*PassportElementTypeDriverLicense) PassportElementTypeType() string {
|
|
return TypePassportElementTypeDriverLicense
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's identity card
|
|
type PassportElementTypeIdentityCard struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypeIdentityCard) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypeIdentityCard
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypeIdentityCard) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypeIdentityCard) GetType() string {
|
|
return TypePassportElementTypeIdentityCard
|
|
}
|
|
|
|
func (*PassportElementTypeIdentityCard) PassportElementTypeType() string {
|
|
return TypePassportElementTypeIdentityCard
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's internal passport
|
|
type PassportElementTypeInternalPassport struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypeInternalPassport) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypeInternalPassport
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypeInternalPassport) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypeInternalPassport) GetType() string {
|
|
return TypePassportElementTypeInternalPassport
|
|
}
|
|
|
|
func (*PassportElementTypeInternalPassport) PassportElementTypeType() string {
|
|
return TypePassportElementTypeInternalPassport
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's address
|
|
type PassportElementTypeAddress struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypeAddress) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypeAddress
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypeAddress) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypeAddress) GetType() string {
|
|
return TypePassportElementTypeAddress
|
|
}
|
|
|
|
func (*PassportElementTypeAddress) PassportElementTypeType() string {
|
|
return TypePassportElementTypeAddress
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's utility bill
|
|
type PassportElementTypeUtilityBill struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypeUtilityBill) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypeUtilityBill
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypeUtilityBill) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypeUtilityBill) GetType() string {
|
|
return TypePassportElementTypeUtilityBill
|
|
}
|
|
|
|
func (*PassportElementTypeUtilityBill) PassportElementTypeType() string {
|
|
return TypePassportElementTypeUtilityBill
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's bank statement
|
|
type PassportElementTypeBankStatement struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypeBankStatement) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypeBankStatement
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypeBankStatement) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypeBankStatement) GetType() string {
|
|
return TypePassportElementTypeBankStatement
|
|
}
|
|
|
|
func (*PassportElementTypeBankStatement) PassportElementTypeType() string {
|
|
return TypePassportElementTypeBankStatement
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's rental agreement
|
|
type PassportElementTypeRentalAgreement struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypeRentalAgreement) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypeRentalAgreement
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypeRentalAgreement) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypeRentalAgreement) GetType() string {
|
|
return TypePassportElementTypeRentalAgreement
|
|
}
|
|
|
|
func (*PassportElementTypeRentalAgreement) PassportElementTypeType() string {
|
|
return TypePassportElementTypeRentalAgreement
|
|
}
|
|
|
|
// A Telegram Passport element containing the registration page of the user's passport
|
|
type PassportElementTypePassportRegistration struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypePassportRegistration) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypePassportRegistration
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypePassportRegistration) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypePassportRegistration) GetType() string {
|
|
return TypePassportElementTypePassportRegistration
|
|
}
|
|
|
|
func (*PassportElementTypePassportRegistration) PassportElementTypeType() string {
|
|
return TypePassportElementTypePassportRegistration
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's temporary registration
|
|
type PassportElementTypeTemporaryRegistration struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypeTemporaryRegistration) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypeTemporaryRegistration
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypeTemporaryRegistration) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypeTemporaryRegistration) GetType() string {
|
|
return TypePassportElementTypeTemporaryRegistration
|
|
}
|
|
|
|
func (*PassportElementTypeTemporaryRegistration) PassportElementTypeType() string {
|
|
return TypePassportElementTypeTemporaryRegistration
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's phone number
|
|
type PassportElementTypePhoneNumber struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypePhoneNumber) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypePhoneNumber
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypePhoneNumber) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypePhoneNumber) GetType() string {
|
|
return TypePassportElementTypePhoneNumber
|
|
}
|
|
|
|
func (*PassportElementTypePhoneNumber) PassportElementTypeType() string {
|
|
return TypePassportElementTypePhoneNumber
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's email address
|
|
type PassportElementTypeEmailAddress struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementTypeEmailAddress) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTypeEmailAddress
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTypeEmailAddress) GetClass() string {
|
|
return ClassPassportElementType
|
|
}
|
|
|
|
func (*PassportElementTypeEmailAddress) GetType() string {
|
|
return TypePassportElementTypeEmailAddress
|
|
}
|
|
|
|
func (*PassportElementTypeEmailAddress) PassportElementTypeType() string {
|
|
return TypePassportElementTypeEmailAddress
|
|
}
|
|
|
|
// Represents a date according to the Gregorian calendar
|
|
type Date struct {
|
|
meta
|
|
// Day of the month; 1-31
|
|
Day int32 `json:"day"`
|
|
// Month; 1-12
|
|
Month int32 `json:"month"`
|
|
// Year; 1-9999
|
|
Year int32 `json:"year"`
|
|
}
|
|
|
|
func (entity *Date) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub Date
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*Date) GetClass() string {
|
|
return ClassDate
|
|
}
|
|
|
|
func (*Date) GetType() string {
|
|
return TypeDate
|
|
}
|
|
|
|
// Contains the user's personal details
|
|
type PersonalDetails struct {
|
|
meta
|
|
// 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) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PersonalDetails
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PersonalDetails) GetClass() string {
|
|
return ClassPersonalDetails
|
|
}
|
|
|
|
func (*PersonalDetails) GetType() string {
|
|
return TypePersonalDetails
|
|
}
|
|
|
|
// An identity document
|
|
type IdentityDocument struct {
|
|
meta
|
|
// Document number; 1-24 characters
|
|
Number string `json:"number"`
|
|
// Document expiration date; may be null if not applicable
|
|
ExpirationDate *Date `json:"expiration_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"`
|
|
}
|
|
|
|
func (entity *IdentityDocument) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub IdentityDocument
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*IdentityDocument) GetClass() string {
|
|
return ClassIdentityDocument
|
|
}
|
|
|
|
func (*IdentityDocument) GetType() string {
|
|
return TypeIdentityDocument
|
|
}
|
|
|
|
// An identity document to be saved to Telegram Passport
|
|
type InputIdentityDocument struct {
|
|
meta
|
|
// Document number; 1-24 characters
|
|
Number string `json:"number"`
|
|
// Document expiration date; pass null if not applicable
|
|
ExpirationDate *Date `json:"expiration_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"`
|
|
}
|
|
|
|
func (entity *InputIdentityDocument) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputIdentityDocument
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputIdentityDocument) GetClass() string {
|
|
return ClassInputIdentityDocument
|
|
}
|
|
|
|
func (*InputIdentityDocument) GetType() string {
|
|
return TypeInputIdentityDocument
|
|
}
|
|
|
|
func (inputIdentityDocument *InputIdentityDocument) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
Number string `json:"number"`
|
|
ExpirationDate *Date `json:"expiration_date"`
|
|
FrontSide json.RawMessage `json:"front_side"`
|
|
ReverseSide json.RawMessage `json:"reverse_side"`
|
|
Selfie json.RawMessage `json:"selfie"`
|
|
Translation []json.RawMessage `json:"translation"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
inputIdentityDocument.Number = tmp.Number
|
|
inputIdentityDocument.ExpirationDate = tmp.ExpirationDate
|
|
|
|
fieldFrontSide, _ := UnmarshalInputFile(tmp.FrontSide)
|
|
inputIdentityDocument.FrontSide = fieldFrontSide
|
|
|
|
fieldReverseSide, _ := UnmarshalInputFile(tmp.ReverseSide)
|
|
inputIdentityDocument.ReverseSide = fieldReverseSide
|
|
|
|
fieldSelfie, _ := UnmarshalInputFile(tmp.Selfie)
|
|
inputIdentityDocument.Selfie = fieldSelfie
|
|
|
|
fieldTranslation, _ := UnmarshalListOfInputFile(tmp.Translation)
|
|
inputIdentityDocument.Translation = fieldTranslation
|
|
|
|
return nil
|
|
}
|
|
|
|
// A personal document, containing some information about a user
|
|
type PersonalDocument struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PersonalDocument) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PersonalDocument
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PersonalDocument) GetClass() string {
|
|
return ClassPersonalDocument
|
|
}
|
|
|
|
func (*PersonalDocument) GetType() string {
|
|
return TypePersonalDocument
|
|
}
|
|
|
|
// A personal document to be saved to Telegram Passport
|
|
type InputPersonalDocument struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *InputPersonalDocument) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPersonalDocument
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPersonalDocument) GetClass() string {
|
|
return ClassInputPersonalDocument
|
|
}
|
|
|
|
func (*InputPersonalDocument) GetType() string {
|
|
return TypeInputPersonalDocument
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's personal details
|
|
type PassportElementPersonalDetails struct {
|
|
meta
|
|
// Personal details of the user
|
|
PersonalDetails *PersonalDetails `json:"personal_details"`
|
|
}
|
|
|
|
func (entity *PassportElementPersonalDetails) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementPersonalDetails
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementPersonalDetails) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementPersonalDetails) GetType() string {
|
|
return TypePassportElementPersonalDetails
|
|
}
|
|
|
|
func (*PassportElementPersonalDetails) PassportElementType() string {
|
|
return TypePassportElementPersonalDetails
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's passport
|
|
type PassportElementPassport struct {
|
|
meta
|
|
// Passport
|
|
Passport *IdentityDocument `json:"passport"`
|
|
}
|
|
|
|
func (entity *PassportElementPassport) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementPassport
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementPassport) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementPassport) GetType() string {
|
|
return TypePassportElementPassport
|
|
}
|
|
|
|
func (*PassportElementPassport) PassportElementType() string {
|
|
return TypePassportElementPassport
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's driver license
|
|
type PassportElementDriverLicense struct {
|
|
meta
|
|
// Driver license
|
|
DriverLicense *IdentityDocument `json:"driver_license"`
|
|
}
|
|
|
|
func (entity *PassportElementDriverLicense) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementDriverLicense
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementDriverLicense) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementDriverLicense) GetType() string {
|
|
return TypePassportElementDriverLicense
|
|
}
|
|
|
|
func (*PassportElementDriverLicense) PassportElementType() string {
|
|
return TypePassportElementDriverLicense
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's identity card
|
|
type PassportElementIdentityCard struct {
|
|
meta
|
|
// Identity card
|
|
IdentityCard *IdentityDocument `json:"identity_card"`
|
|
}
|
|
|
|
func (entity *PassportElementIdentityCard) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementIdentityCard
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementIdentityCard) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementIdentityCard) GetType() string {
|
|
return TypePassportElementIdentityCard
|
|
}
|
|
|
|
func (*PassportElementIdentityCard) PassportElementType() string {
|
|
return TypePassportElementIdentityCard
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's internal passport
|
|
type PassportElementInternalPassport struct {
|
|
meta
|
|
// Internal passport
|
|
InternalPassport *IdentityDocument `json:"internal_passport"`
|
|
}
|
|
|
|
func (entity *PassportElementInternalPassport) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementInternalPassport
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementInternalPassport) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementInternalPassport) GetType() string {
|
|
return TypePassportElementInternalPassport
|
|
}
|
|
|
|
func (*PassportElementInternalPassport) PassportElementType() string {
|
|
return TypePassportElementInternalPassport
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's address
|
|
type PassportElementAddress struct {
|
|
meta
|
|
// Address
|
|
Address *Address `json:"address"`
|
|
}
|
|
|
|
func (entity *PassportElementAddress) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementAddress
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementAddress) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementAddress) GetType() string {
|
|
return TypePassportElementAddress
|
|
}
|
|
|
|
func (*PassportElementAddress) PassportElementType() string {
|
|
return TypePassportElementAddress
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's utility bill
|
|
type PassportElementUtilityBill struct {
|
|
meta
|
|
// Utility bill
|
|
UtilityBill *PersonalDocument `json:"utility_bill"`
|
|
}
|
|
|
|
func (entity *PassportElementUtilityBill) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementUtilityBill
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementUtilityBill) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementUtilityBill) GetType() string {
|
|
return TypePassportElementUtilityBill
|
|
}
|
|
|
|
func (*PassportElementUtilityBill) PassportElementType() string {
|
|
return TypePassportElementUtilityBill
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's bank statement
|
|
type PassportElementBankStatement struct {
|
|
meta
|
|
// Bank statement
|
|
BankStatement *PersonalDocument `json:"bank_statement"`
|
|
}
|
|
|
|
func (entity *PassportElementBankStatement) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementBankStatement
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementBankStatement) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementBankStatement) GetType() string {
|
|
return TypePassportElementBankStatement
|
|
}
|
|
|
|
func (*PassportElementBankStatement) PassportElementType() string {
|
|
return TypePassportElementBankStatement
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's rental agreement
|
|
type PassportElementRentalAgreement struct {
|
|
meta
|
|
// Rental agreement
|
|
RentalAgreement *PersonalDocument `json:"rental_agreement"`
|
|
}
|
|
|
|
func (entity *PassportElementRentalAgreement) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementRentalAgreement
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementRentalAgreement) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementRentalAgreement) GetType() string {
|
|
return TypePassportElementRentalAgreement
|
|
}
|
|
|
|
func (*PassportElementRentalAgreement) PassportElementType() string {
|
|
return TypePassportElementRentalAgreement
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's passport registration pages
|
|
type PassportElementPassportRegistration struct {
|
|
meta
|
|
// Passport registration pages
|
|
PassportRegistration *PersonalDocument `json:"passport_registration"`
|
|
}
|
|
|
|
func (entity *PassportElementPassportRegistration) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementPassportRegistration
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementPassportRegistration) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementPassportRegistration) GetType() string {
|
|
return TypePassportElementPassportRegistration
|
|
}
|
|
|
|
func (*PassportElementPassportRegistration) PassportElementType() string {
|
|
return TypePassportElementPassportRegistration
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's temporary registration
|
|
type PassportElementTemporaryRegistration struct {
|
|
meta
|
|
// Temporary registration
|
|
TemporaryRegistration *PersonalDocument `json:"temporary_registration"`
|
|
}
|
|
|
|
func (entity *PassportElementTemporaryRegistration) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementTemporaryRegistration
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementTemporaryRegistration) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementTemporaryRegistration) GetType() string {
|
|
return TypePassportElementTemporaryRegistration
|
|
}
|
|
|
|
func (*PassportElementTemporaryRegistration) PassportElementType() string {
|
|
return TypePassportElementTemporaryRegistration
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's phone number
|
|
type PassportElementPhoneNumber struct {
|
|
meta
|
|
// Phone number
|
|
PhoneNumber string `json:"phone_number"`
|
|
}
|
|
|
|
func (entity *PassportElementPhoneNumber) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementPhoneNumber
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementPhoneNumber) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementPhoneNumber) GetType() string {
|
|
return TypePassportElementPhoneNumber
|
|
}
|
|
|
|
func (*PassportElementPhoneNumber) PassportElementType() string {
|
|
return TypePassportElementPhoneNumber
|
|
}
|
|
|
|
// A Telegram Passport element containing the user's email address
|
|
type PassportElementEmailAddress struct {
|
|
meta
|
|
// Email address
|
|
EmailAddress string `json:"email_address"`
|
|
}
|
|
|
|
func (entity *PassportElementEmailAddress) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementEmailAddress
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementEmailAddress) GetClass() string {
|
|
return ClassPassportElement
|
|
}
|
|
|
|
func (*PassportElementEmailAddress) GetType() string {
|
|
return TypePassportElementEmailAddress
|
|
}
|
|
|
|
func (*PassportElementEmailAddress) PassportElementType() string {
|
|
return TypePassportElementEmailAddress
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's personal details
|
|
type InputPassportElementPersonalDetails struct {
|
|
meta
|
|
// Personal details of the user
|
|
PersonalDetails *PersonalDetails `json:"personal_details"`
|
|
}
|
|
|
|
func (entity *InputPassportElementPersonalDetails) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementPersonalDetails
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementPersonalDetails) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementPersonalDetails) GetType() string {
|
|
return TypeInputPassportElementPersonalDetails
|
|
}
|
|
|
|
func (*InputPassportElementPersonalDetails) InputPassportElementType() string {
|
|
return TypeInputPassportElementPersonalDetails
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's passport
|
|
type InputPassportElementPassport struct {
|
|
meta
|
|
// The passport to be saved
|
|
Passport *InputIdentityDocument `json:"passport"`
|
|
}
|
|
|
|
func (entity *InputPassportElementPassport) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementPassport
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementPassport) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementPassport) GetType() string {
|
|
return TypeInputPassportElementPassport
|
|
}
|
|
|
|
func (*InputPassportElementPassport) InputPassportElementType() string {
|
|
return TypeInputPassportElementPassport
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's driver license
|
|
type InputPassportElementDriverLicense struct {
|
|
meta
|
|
// The driver license to be saved
|
|
DriverLicense *InputIdentityDocument `json:"driver_license"`
|
|
}
|
|
|
|
func (entity *InputPassportElementDriverLicense) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementDriverLicense
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementDriverLicense) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementDriverLicense) GetType() string {
|
|
return TypeInputPassportElementDriverLicense
|
|
}
|
|
|
|
func (*InputPassportElementDriverLicense) InputPassportElementType() string {
|
|
return TypeInputPassportElementDriverLicense
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's identity card
|
|
type InputPassportElementIdentityCard struct {
|
|
meta
|
|
// The identity card to be saved
|
|
IdentityCard *InputIdentityDocument `json:"identity_card"`
|
|
}
|
|
|
|
func (entity *InputPassportElementIdentityCard) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementIdentityCard
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementIdentityCard) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementIdentityCard) GetType() string {
|
|
return TypeInputPassportElementIdentityCard
|
|
}
|
|
|
|
func (*InputPassportElementIdentityCard) InputPassportElementType() string {
|
|
return TypeInputPassportElementIdentityCard
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's internal passport
|
|
type InputPassportElementInternalPassport struct {
|
|
meta
|
|
// The internal passport to be saved
|
|
InternalPassport *InputIdentityDocument `json:"internal_passport"`
|
|
}
|
|
|
|
func (entity *InputPassportElementInternalPassport) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementInternalPassport
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementInternalPassport) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementInternalPassport) GetType() string {
|
|
return TypeInputPassportElementInternalPassport
|
|
}
|
|
|
|
func (*InputPassportElementInternalPassport) InputPassportElementType() string {
|
|
return TypeInputPassportElementInternalPassport
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's address
|
|
type InputPassportElementAddress struct {
|
|
meta
|
|
// The address to be saved
|
|
Address *Address `json:"address"`
|
|
}
|
|
|
|
func (entity *InputPassportElementAddress) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementAddress
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementAddress) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementAddress) GetType() string {
|
|
return TypeInputPassportElementAddress
|
|
}
|
|
|
|
func (*InputPassportElementAddress) InputPassportElementType() string {
|
|
return TypeInputPassportElementAddress
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's utility bill
|
|
type InputPassportElementUtilityBill struct {
|
|
meta
|
|
// The utility bill to be saved
|
|
UtilityBill *InputPersonalDocument `json:"utility_bill"`
|
|
}
|
|
|
|
func (entity *InputPassportElementUtilityBill) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementUtilityBill
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementUtilityBill) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementUtilityBill) GetType() string {
|
|
return TypeInputPassportElementUtilityBill
|
|
}
|
|
|
|
func (*InputPassportElementUtilityBill) InputPassportElementType() string {
|
|
return TypeInputPassportElementUtilityBill
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's bank statement
|
|
type InputPassportElementBankStatement struct {
|
|
meta
|
|
// The bank statement to be saved
|
|
BankStatement *InputPersonalDocument `json:"bank_statement"`
|
|
}
|
|
|
|
func (entity *InputPassportElementBankStatement) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementBankStatement
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementBankStatement) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementBankStatement) GetType() string {
|
|
return TypeInputPassportElementBankStatement
|
|
}
|
|
|
|
func (*InputPassportElementBankStatement) InputPassportElementType() string {
|
|
return TypeInputPassportElementBankStatement
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's rental agreement
|
|
type InputPassportElementRentalAgreement struct {
|
|
meta
|
|
// The rental agreement to be saved
|
|
RentalAgreement *InputPersonalDocument `json:"rental_agreement"`
|
|
}
|
|
|
|
func (entity *InputPassportElementRentalAgreement) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementRentalAgreement
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementRentalAgreement) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementRentalAgreement) GetType() string {
|
|
return TypeInputPassportElementRentalAgreement
|
|
}
|
|
|
|
func (*InputPassportElementRentalAgreement) InputPassportElementType() string {
|
|
return TypeInputPassportElementRentalAgreement
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's passport registration
|
|
type InputPassportElementPassportRegistration struct {
|
|
meta
|
|
// The passport registration page to be saved
|
|
PassportRegistration *InputPersonalDocument `json:"passport_registration"`
|
|
}
|
|
|
|
func (entity *InputPassportElementPassportRegistration) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementPassportRegistration
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementPassportRegistration) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementPassportRegistration) GetType() string {
|
|
return TypeInputPassportElementPassportRegistration
|
|
}
|
|
|
|
func (*InputPassportElementPassportRegistration) InputPassportElementType() string {
|
|
return TypeInputPassportElementPassportRegistration
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's temporary registration
|
|
type InputPassportElementTemporaryRegistration struct {
|
|
meta
|
|
// The temporary registration document to be saved
|
|
TemporaryRegistration *InputPersonalDocument `json:"temporary_registration"`
|
|
}
|
|
|
|
func (entity *InputPassportElementTemporaryRegistration) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementTemporaryRegistration
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementTemporaryRegistration) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementTemporaryRegistration) GetType() string {
|
|
return TypeInputPassportElementTemporaryRegistration
|
|
}
|
|
|
|
func (*InputPassportElementTemporaryRegistration) InputPassportElementType() string {
|
|
return TypeInputPassportElementTemporaryRegistration
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's phone number
|
|
type InputPassportElementPhoneNumber struct {
|
|
meta
|
|
// The phone number to be saved
|
|
PhoneNumber string `json:"phone_number"`
|
|
}
|
|
|
|
func (entity *InputPassportElementPhoneNumber) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementPhoneNumber
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementPhoneNumber) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementPhoneNumber) GetType() string {
|
|
return TypeInputPassportElementPhoneNumber
|
|
}
|
|
|
|
func (*InputPassportElementPhoneNumber) InputPassportElementType() string {
|
|
return TypeInputPassportElementPhoneNumber
|
|
}
|
|
|
|
// A Telegram Passport element to be saved containing the user's email address
|
|
type InputPassportElementEmailAddress struct {
|
|
meta
|
|
// The email address to be saved
|
|
EmailAddress string `json:"email_address"`
|
|
}
|
|
|
|
func (entity *InputPassportElementEmailAddress) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementEmailAddress
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementEmailAddress) GetClass() string {
|
|
return ClassInputPassportElement
|
|
}
|
|
|
|
func (*InputPassportElementEmailAddress) GetType() string {
|
|
return TypeInputPassportElementEmailAddress
|
|
}
|
|
|
|
func (*InputPassportElementEmailAddress) InputPassportElementType() string {
|
|
return TypeInputPassportElementEmailAddress
|
|
}
|
|
|
|
// Contains information about saved Telegram Passport elements
|
|
type PassportElements struct {
|
|
meta
|
|
// Telegram Passport elements
|
|
Elements []PassportElement `json:"elements"`
|
|
}
|
|
|
|
func (entity *PassportElements) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElements
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElements) GetClass() string {
|
|
return ClassPassportElements
|
|
}
|
|
|
|
func (*PassportElements) GetType() string {
|
|
return TypePassportElements
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// The element contains an error in an unspecified place. The error will be considered resolved when new data is added
|
|
type PassportElementErrorSourceUnspecified struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementErrorSourceUnspecified) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementErrorSourceUnspecified
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementErrorSourceUnspecified) GetClass() string {
|
|
return ClassPassportElementErrorSource
|
|
}
|
|
|
|
func (*PassportElementErrorSourceUnspecified) GetType() string {
|
|
return TypePassportElementErrorSourceUnspecified
|
|
}
|
|
|
|
func (*PassportElementErrorSourceUnspecified) PassportElementErrorSourceType() string {
|
|
return TypePassportElementErrorSourceUnspecified
|
|
}
|
|
|
|
// One of the data fields contains an error. The error will be considered resolved when the value of the field changes
|
|
type PassportElementErrorSourceDataField struct {
|
|
meta
|
|
// Field name
|
|
FieldName string `json:"field_name"`
|
|
}
|
|
|
|
func (entity *PassportElementErrorSourceDataField) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementErrorSourceDataField
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementErrorSourceDataField) GetClass() string {
|
|
return ClassPassportElementErrorSource
|
|
}
|
|
|
|
func (*PassportElementErrorSourceDataField) GetType() string {
|
|
return TypePassportElementErrorSourceDataField
|
|
}
|
|
|
|
func (*PassportElementErrorSourceDataField) PassportElementErrorSourceType() string {
|
|
return TypePassportElementErrorSourceDataField
|
|
}
|
|
|
|
// 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{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementErrorSourceFrontSide) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementErrorSourceFrontSide
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementErrorSourceFrontSide) GetClass() string {
|
|
return ClassPassportElementErrorSource
|
|
}
|
|
|
|
func (*PassportElementErrorSourceFrontSide) GetType() string {
|
|
return TypePassportElementErrorSourceFrontSide
|
|
}
|
|
|
|
func (*PassportElementErrorSourceFrontSide) PassportElementErrorSourceType() string {
|
|
return TypePassportElementErrorSourceFrontSide
|
|
}
|
|
|
|
// 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{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementErrorSourceReverseSide) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementErrorSourceReverseSide
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementErrorSourceReverseSide) GetClass() string {
|
|
return ClassPassportElementErrorSource
|
|
}
|
|
|
|
func (*PassportElementErrorSourceReverseSide) GetType() string {
|
|
return TypePassportElementErrorSourceReverseSide
|
|
}
|
|
|
|
func (*PassportElementErrorSourceReverseSide) PassportElementErrorSourceType() string {
|
|
return TypePassportElementErrorSourceReverseSide
|
|
}
|
|
|
|
// The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes
|
|
type PassportElementErrorSourceSelfie struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementErrorSourceSelfie) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementErrorSourceSelfie
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementErrorSourceSelfie) GetClass() string {
|
|
return ClassPassportElementErrorSource
|
|
}
|
|
|
|
func (*PassportElementErrorSourceSelfie) GetType() string {
|
|
return TypePassportElementErrorSourceSelfie
|
|
}
|
|
|
|
func (*PassportElementErrorSourceSelfie) PassportElementErrorSourceType() string {
|
|
return TypePassportElementErrorSourceSelfie
|
|
}
|
|
|
|
// 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 {
|
|
meta
|
|
// Index of a file with the error
|
|
FileIndex int32 `json:"file_index"`
|
|
}
|
|
|
|
func (entity *PassportElementErrorSourceTranslationFile) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementErrorSourceTranslationFile
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementErrorSourceTranslationFile) GetClass() string {
|
|
return ClassPassportElementErrorSource
|
|
}
|
|
|
|
func (*PassportElementErrorSourceTranslationFile) GetType() string {
|
|
return TypePassportElementErrorSourceTranslationFile
|
|
}
|
|
|
|
func (*PassportElementErrorSourceTranslationFile) PassportElementErrorSourceType() string {
|
|
return TypePassportElementErrorSourceTranslationFile
|
|
}
|
|
|
|
// The translation of the document contains an error. The error will be considered resolved when the list of translation files changes
|
|
type PassportElementErrorSourceTranslationFiles struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementErrorSourceTranslationFiles) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementErrorSourceTranslationFiles
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementErrorSourceTranslationFiles) GetClass() string {
|
|
return ClassPassportElementErrorSource
|
|
}
|
|
|
|
func (*PassportElementErrorSourceTranslationFiles) GetType() string {
|
|
return TypePassportElementErrorSourceTranslationFiles
|
|
}
|
|
|
|
func (*PassportElementErrorSourceTranslationFiles) PassportElementErrorSourceType() string {
|
|
return TypePassportElementErrorSourceTranslationFiles
|
|
}
|
|
|
|
// The file contains an error. The error will be considered resolved when the file changes
|
|
type PassportElementErrorSourceFile struct {
|
|
meta
|
|
// Index of a file with the error
|
|
FileIndex int32 `json:"file_index"`
|
|
}
|
|
|
|
func (entity *PassportElementErrorSourceFile) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementErrorSourceFile
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementErrorSourceFile) GetClass() string {
|
|
return ClassPassportElementErrorSource
|
|
}
|
|
|
|
func (*PassportElementErrorSourceFile) GetType() string {
|
|
return TypePassportElementErrorSourceFile
|
|
}
|
|
|
|
func (*PassportElementErrorSourceFile) PassportElementErrorSourceType() string {
|
|
return TypePassportElementErrorSourceFile
|
|
}
|
|
|
|
// The list of attached files contains an error. The error will be considered resolved when the list of files changes
|
|
type PassportElementErrorSourceFiles struct{
|
|
meta
|
|
}
|
|
|
|
func (entity *PassportElementErrorSourceFiles) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementErrorSourceFiles
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementErrorSourceFiles) GetClass() string {
|
|
return ClassPassportElementErrorSource
|
|
}
|
|
|
|
func (*PassportElementErrorSourceFiles) GetType() string {
|
|
return TypePassportElementErrorSourceFiles
|
|
}
|
|
|
|
func (*PassportElementErrorSourceFiles) PassportElementErrorSourceType() string {
|
|
return TypePassportElementErrorSourceFiles
|
|
}
|
|
|
|
// Contains the description of an error in a Telegram Passport element
|
|
type PassportElementError struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PassportElementError) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementError
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementError) GetClass() string {
|
|
return ClassPassportElementError
|
|
}
|
|
|
|
func (*PassportElementError) GetType() string {
|
|
return TypePassportElementError
|
|
}
|
|
|
|
func (passportElementError *PassportElementError) 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
|
|
}
|
|
|
|
passportElementError.Message = tmp.Message
|
|
|
|
fieldType, _ := UnmarshalPassportElementType(tmp.Type)
|
|
passportElementError.Type = fieldType
|
|
|
|
fieldSource, _ := UnmarshalPassportElementErrorSource(tmp.Source)
|
|
passportElementError.Source = fieldSource
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains information about a Telegram Passport element that was requested by a service
|
|
type PassportSuitableElement struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PassportSuitableElement) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportSuitableElement
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportSuitableElement) GetClass() string {
|
|
return ClassPassportSuitableElement
|
|
}
|
|
|
|
func (*PassportSuitableElement) GetType() string {
|
|
return TypePassportSuitableElement
|
|
}
|
|
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
passportSuitableElement.IsSelfieRequired = tmp.IsSelfieRequired
|
|
passportSuitableElement.IsTranslationRequired = tmp.IsTranslationRequired
|
|
passportSuitableElement.IsNativeNameRequired = tmp.IsNativeNameRequired
|
|
|
|
fieldType, _ := UnmarshalPassportElementType(tmp.Type)
|
|
passportSuitableElement.Type = fieldType
|
|
|
|
return nil
|
|
}
|
|
|
|
// Contains a description of the required Telegram Passport element that was requested by a service
|
|
type PassportRequiredElement struct {
|
|
meta
|
|
// List of Telegram Passport elements any of which is enough to provide
|
|
SuitableElements []*PassportSuitableElement `json:"suitable_elements"`
|
|
}
|
|
|
|
func (entity *PassportRequiredElement) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportRequiredElement
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportRequiredElement) GetClass() string {
|
|
return ClassPassportRequiredElement
|
|
}
|
|
|
|
func (*PassportRequiredElement) GetType() string {
|
|
return TypePassportRequiredElement
|
|
}
|
|
|
|
// Contains information about a Telegram Passport authorization form that was requested
|
|
type PassportAuthorizationForm struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *PassportAuthorizationForm) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportAuthorizationForm
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportAuthorizationForm) GetClass() string {
|
|
return ClassPassportAuthorizationForm
|
|
}
|
|
|
|
func (*PassportAuthorizationForm) GetType() string {
|
|
return TypePassportAuthorizationForm
|
|
}
|
|
|
|
// Contains information about a Telegram Passport elements and corresponding errors
|
|
type PassportElementsWithErrors struct {
|
|
meta
|
|
// Telegram Passport elements
|
|
Elements []PassportElement `json:"elements"`
|
|
// Errors in the elements that are already available
|
|
Errors []*PassportElementError `json:"errors"`
|
|
}
|
|
|
|
func (entity *PassportElementsWithErrors) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub PassportElementsWithErrors
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*PassportElementsWithErrors) GetClass() string {
|
|
return ClassPassportElementsWithErrors
|
|
}
|
|
|
|
func (*PassportElementsWithErrors) GetType() string {
|
|
return TypePassportElementsWithErrors
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
// Contains encrypted Telegram Passport data credentials
|
|
type EncryptedCredentials struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *EncryptedCredentials) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub EncryptedCredentials
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*EncryptedCredentials) GetClass() string {
|
|
return ClassEncryptedCredentials
|
|
}
|
|
|
|
func (*EncryptedCredentials) GetType() string {
|
|
return TypeEncryptedCredentials
|
|
}
|
|
|
|
// Contains information about an encrypted Telegram Passport element; for bots only
|
|
type EncryptedPassportElement struct {
|
|
meta
|
|
// 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"`
|
|
}
|
|
|
|
func (entity *EncryptedPassportElement) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub EncryptedPassportElement
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*EncryptedPassportElement) GetClass() string {
|
|
return ClassEncryptedPassportElement
|
|
}
|
|
|
|
func (*EncryptedPassportElement) GetType() string {
|
|
return TypeEncryptedPassportElement
|
|
}
|
|
|
|
func (encryptedPassportElement *EncryptedPassportElement) UnmarshalJSON(data []byte) error {
|
|
var tmp struct {
|
|
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"`
|
|
}
|
|
|
|
err := json.Unmarshal(data, &tmp)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
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
|
|
|
|
fieldType, _ := UnmarshalPassportElementType(tmp.Type)
|
|
encryptedPassportElement.Type = fieldType
|
|
|
|
return nil
|
|
}
|
|
|
|
// The element contains an error in an unspecified place. The error will be considered resolved when new data is added
|
|
type InputPassportElementErrorSourceUnspecified struct {
|
|
meta
|
|
// Current hash of the entire element
|
|
ElementHash []byte `json:"element_hash"`
|
|
}
|
|
|
|
func (entity *InputPassportElementErrorSourceUnspecified) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementErrorSourceUnspecified
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceUnspecified) GetClass() string {
|
|
return ClassInputPassportElementErrorSource
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceUnspecified) GetType() string {
|
|
return TypeInputPassportElementErrorSourceUnspecified
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceUnspecified) InputPassportElementErrorSourceType() string {
|
|
return TypeInputPassportElementErrorSourceUnspecified
|
|
}
|
|
|
|
// A data field contains an error. The error is considered resolved when the field's value changes
|
|
type InputPassportElementErrorSourceDataField struct {
|
|
meta
|
|
// Field name
|
|
FieldName string `json:"field_name"`
|
|
// Current data hash
|
|
DataHash []byte `json:"data_hash"`
|
|
}
|
|
|
|
func (entity *InputPassportElementErrorSourceDataField) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementErrorSourceDataField
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceDataField) GetClass() string {
|
|
return ClassInputPassportElementErrorSource
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceDataField) GetType() string {
|
|
return TypeInputPassportElementErrorSourceDataField
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceDataField) InputPassportElementErrorSourceType() string {
|
|
return TypeInputPassportElementErrorSourceDataField
|
|
}
|
|
|
|
// 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 {
|
|
meta
|
|
// Current hash of the file containing the front side
|
|
FileHash []byte `json:"file_hash"`
|
|
}
|
|
|
|
func (entity *InputPassportElementErrorSourceFrontSide) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementErrorSourceFrontSide
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceFrontSide) GetClass() string {
|
|
return ClassInputPassportElementErrorSource
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceFrontSide) GetType() string {
|
|
return TypeInputPassportElementErrorSourceFrontSide
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceFrontSide) InputPassportElementErrorSourceType() string {
|
|
return TypeInputPassportElementErrorSourceFrontSide
|
|
}
|
|
|
|
// 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 {
|
|
meta
|
|
// Current hash of the file containing the reverse side
|
|
FileHash []byte `json:"file_hash"`
|
|
}
|
|
|
|
func (entity *InputPassportElementErrorSourceReverseSide) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementErrorSourceReverseSide
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceReverseSide) GetClass() string {
|
|
return ClassInputPassportElementErrorSource
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceReverseSide) GetType() string {
|
|
return TypeInputPassportElementErrorSourceReverseSide
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceReverseSide) InputPassportElementErrorSourceType() string {
|
|
return TypeInputPassportElementErrorSourceReverseSide
|
|
}
|
|
|
|
// The selfie contains an error. The error is considered resolved when the file with the selfie changes
|
|
type InputPassportElementErrorSourceSelfie struct {
|
|
meta
|
|
// Current hash of the file containing the selfie
|
|
FileHash []byte `json:"file_hash"`
|
|
}
|
|
|
|
func (entity *InputPassportElementErrorSourceSelfie) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementErrorSourceSelfie
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceSelfie) GetClass() string {
|
|
return ClassInputPassportElementErrorSource
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceSelfie) GetType() string {
|
|
return TypeInputPassportElementErrorSourceSelfie
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceSelfie) InputPassportElementErrorSourceType() string {
|
|
return TypeInputPassportElementErrorSourceSelfie
|
|
}
|
|
|
|
// 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 {
|
|
meta
|
|
// Current hash of the file containing the translation
|
|
FileHash []byte `json:"file_hash"`
|
|
}
|
|
|
|
func (entity *InputPassportElementErrorSourceTranslationFile) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementErrorSourceTranslationFile
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceTranslationFile) GetClass() string {
|
|
return ClassInputPassportElementErrorSource
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceTranslationFile) GetType() string {
|
|
return TypeInputPassportElementErrorSourceTranslationFile
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceTranslationFile) InputPassportElementErrorSourceType() string {
|
|
return TypeInputPassportElementErrorSourceTranslationFile
|
|
}
|
|
|
|
// The translation of the document contains an error. The error is considered resolved when the list of files changes
|
|
type InputPassportElementErrorSourceTranslationFiles struct {
|
|
meta
|
|
// Current hashes of all files with the translation
|
|
FileHashes [][]byte `json:"file_hashes"`
|
|
}
|
|
|
|
func (entity *InputPassportElementErrorSourceTranslationFiles) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementErrorSourceTranslationFiles
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceTranslationFiles) GetClass() string {
|
|
return ClassInputPassportElementErrorSource
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceTranslationFiles) GetType() string {
|
|
return TypeInputPassportElementErrorSourceTranslationFiles
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceTranslationFiles) InputPassportElementErrorSourceType() string {
|
|
return TypeInputPassportElementErrorSourceTranslationFiles
|
|
}
|
|
|
|
// The file contains an error. The error is considered resolved when the file changes
|
|
type InputPassportElementErrorSourceFile struct {
|
|
meta
|
|
// Current hash of the file which has the error
|
|
FileHash []byte `json:"file_hash"`
|
|
}
|
|
|
|
func (entity *InputPassportElementErrorSourceFile) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementErrorSourceFile
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceFile) GetClass() string {
|
|
return ClassInputPassportElementErrorSource
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceFile) GetType() string {
|
|
return TypeInputPassportElementErrorSourceFile
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceFile) InputPassportElementErrorSourceType() string {
|
|
return TypeInputPassportElementErrorSourceFile
|
|
}
|
|
|
|
// The list of attached files contains an error. The error is considered resolved when the file list changes
|
|
type InputPassportElementErrorSourceFiles struct {
|
|
meta
|
|
// Current hashes of all attached files
|
|
FileHashes [][]byte `json:"file_hashes"`
|
|
}
|
|
|
|
func (entity *InputPassportElementErrorSourceFiles) MarshalJSON() ([]byte, error) {
|
|
entity.meta.Type = entity.GetType()
|
|
|
|
type stub InputPassportElementErrorSourceFiles
|
|
|
|
return json.Marshal((*stub)(entity))
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceFiles) GetClass() string {
|
|
return ClassInputPassportElementErrorSource
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceFiles) GetType() string {
|
|
return TypeInputPassportElementErrorSourceFiles
|
|
}
|
|
|
|
func (*InputPassportElementErrorSourceFiles) InputPassportElementErrorSourceType() string {
|
|
return TypeInputPassportElementErrorSourceFiles
|
|
}
|
|
|
|
// Contains the description of an error in a Telegram Passport element; for bots only
|
|
type InputPassportElementError struct {
|
|
meta
|
|
// Type of Telegram Passport element that has the error
|
|
Type PassportElementType `json:"type"`
|
|
// Error message
|
|