Update
public indirect enum Update : Codable, Equatable, FunctionResult, TDEnum, EquatableEnum
Contains notifications about data changes
-
The user authorization state has changed
- authorizationState: New authorization state
Declaration
Swift
case authorizationState(authorizationState: AuthorizationState)
-
A new message was received; can also be an outgoing message
- message: The new message
Declaration
Swift
case newMessage(message: Message)
-
A request to send a message has reached the Telegram server. This doesn’t mean that the message will be sent successfully or even that the send message request will be processed. This update will be sent only if the option “use_quick_ack” is set to true. This update may be sent multiple times for the same message
- chatId: The chat identifier of the sent message
- messageId: A temporary message identifier
-
A message has been successfully sent
- message: Information about the sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change
- oldMessageId: The previous temporary message identifier
-
A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update
- message: Contains information about the message which failed to send
- oldMessageId: The previous temporary message identifier
- errorCode: An error code
- errorMessage: Error message
Declaration
-
The message content has changed
- chatId: Chat identifier
- messageId: Message identifier
- newContent: New message content
Declaration
Swift
case messageContent(chatId: Int53, messageId: Int53, newContent: MessageContent)
-
A message was edited. Changes in the message content will come in a separate updateMessageContent
- chatId: Chat identifier
- messageId: Message identifier
- editDate: Point in time (Unix timestamp) when the message was edited
- replyMarkup: New message reply markup; may be null
Declaration
Swift
case messageEdited(chatId: Int53, messageId: Int53, editDate: Int32, replyMarkup: ReplyMarkup?)
-
The view count of the message has changed
- chatId: Chat identifier
- messageId: Message identifier
- views: New value of the view count
-
The message content was opened. Updates voice note messages to “listened”, video note messages to “viewed” and starts the TTL timer for self-destructing messages
- chatId: Chat identifier
- messageId: Message identifier
-
A message with an unread mention was read
- chatId: Chat identifier
- messageId: Message identifier
- unreadMentionCount: The new number of unread mention messages left in the chat
Declaration
-
A message with a live location was viewed. When the update is received, the client is supposed to update the live location
- chatId: Identifier of the chat with the live location message
- messageId: Identifier of the message with live location
-
A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the client. The chat field changes will be reported through separate updates
- chat: The chat
Declaration
Swift
case newChat(chat: Chat)
-
The list to which the chat belongs was changed. This update is guaranteed to be sent only when chat.order == 0 and the current or the new chat list is null
- chatId: Chat identifier
- chatList: The new chat’s chat list; may be null
-
The title of a chat was changed
- chatId: Chat identifier
- title: The new chat title
Declaration
Swift
case chatTitle(chatId: Int53, title: String)
-
A chat photo was changed
- chatId: Chat identifier
- photo: The new chat photo; may be null
-
Chat permissions was changed
- chatId: Chat identifier
- permissions: The new chat permissions
Declaration
Swift
case chatPermissions(chatId: Int53, permissions: ChatPermissions)
-
The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case
- chatId: Chat identifier
- lastMessage: The new last message in the chat; may be null
- order: New value of the chat order
-
The order of the chat in the chat list has changed. Instead of this update updateChatLastMessage, updateChatIsPinned, updateChatDraftMessage, or updateChatIsSponsored might be sent
- chatId: Chat identifier
- order: New value of the order
-
A chat was pinned or unpinned
- chatId: Chat identifier
- isPinned: New value of is_pinned
- order: New value of the chat order
-
A chat was marked as unread or was read
- chatId: Chat identifier
- isMarkedAsUnread: New value of is_marked_as_unread
Declaration
Swift
case chatIsMarkedAsUnread(chatId: Int53, isMarkedAsUnread: Bool)
-
A chat’s is_sponsored field has changed
- chatId: Chat identifier
- isSponsored: New value of is_sponsored
- order: New value of chat order
-
A chat’s has_scheduled_messages field has changed
- chatId: Chat identifier
- hasScheduledMessages: New value of has_scheduled_messages
Declaration
Swift
case chatHasScheduledMessages(chatId: Int53, hasScheduledMessages: Bool)
-
The value of the default disable_notification parameter, used when a message is sent to the chat, was changed
- chatId: Chat identifier
- defaultDisableNotification: The new default_disable_notification value
Declaration
Swift
case chatDefaultDisableNotification(chatId: Int53, defaultDisableNotification: Bool)
-
Incoming messages were read or number of unread messages has been changed
- chatId: Chat identifier
- lastReadInboxMessageId: Identifier of the last read incoming message
- unreadCount: The number of unread messages left in the chat
Declaration
-
Outgoing messages were read
- chatId: Chat identifier
- lastReadOutboxMessageId: Identifier of last read outgoing message
-
The chat unread_mention_count has changed
- chatId: Chat identifier
- unreadMentionCount: The number of unread mention messages left in the chat
Declaration
Swift
case chatUnreadMentionCount(chatId: Int53, unreadMentionCount: Int32)
-
Notification settings for a chat were changed
- chatId: Chat identifier
- notificationSettings: The new notification settings
Declaration
Swift
case chatNotificationSettings(chatId: Int53, notificationSettings: ChatNotificationSettings)
-
Notification settings for some type of chats were updated
- scope: Types of chats for which notification settings were updated
- notificationSettings: The new notification settings
Declaration
Swift
case scopeNotificationSettings(scope: NotificationSettingsScope, notificationSettings: ScopeNotificationSettings)
-
The chat action bar was changed
- chatId: Chat identifier
- actionBar: The new value of the action bar; may be null
Declaration
Swift
case chatActionBar(chatId: Int53, actionBar: ChatActionBar?)
-
The chat pinned message was changed
- chatId: Chat identifier
- pinnedMessageId: The new identifier of the pinned message; 0 if there is no pinned message in the chat
-
The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user
- chatId: Chat identifier
- replyMarkupMessageId: Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
-
A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update shouldn’t be applied
- chatId: Chat identifier
- draftMessage: The new draft message; may be null
- order: New value of the chat order
Declaration
Swift
case chatDraftMessage(chatId: Int53, draftMessage: DraftMessage?, order: TDInt64)
-
The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed
- chatId: Identifier of the chat
- onlineMemberCount: New number of online members in the chat, or 0 if unknown
Declaration
Swift
case chatOnlineMemberCount(chatId: Int53, onlineMemberCount: Int32)
-
A notification was changed
- notificationGroupId: Unique notification group identifier
- notification: Changed notification
Declaration
Swift
case notification(notificationGroupId: Int32, notification: Notification)
-
notificationGroup(notificationGroupId:type:chatId:notificationSettingsChatId:isSilent:totalCount:addedNotifications:removedNotificationIds:)
A list of active notifications in a notification group has changed
- notificationGroupId: Unique notification group identifier
- type: New type of the notification group
- chatId: Identifier of a chat to which all notifications in the group belong
- notificationSettingsChatId: Chat identifier, which notification settings must be applied to the added notifications
- isSilent: True, if the notifications should be shown without sound
- totalCount: Total number of unread notifications in the group, can be bigger than number of active notifications
- addedNotifications: List of added group notifications, sorted by notification ID
- removedNotificationIds: Identifiers of removed group notifications, sorted by notification ID
Declaration
Swift
case notificationGroup(notificationGroupId: Int32, type: NotificationGroupType, chatId: Int53, notificationSettingsChatId: Int53, isSilent: Bool, totalCount: Int32, addedNotifications: [Notification], removedNotificationIds: [Int32])
-
Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update
- groups: Lists of active notification groups
Declaration
Swift
case activeNotifications(groups: [NotificationGroup])
-
Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications
- haveDelayedNotifications: True, if there are some delayed notification updates, which will be sent soon
- haveUnreceivedNotifications: True, if there can be some yet unreceived notifications, which are being fetched from the server
Declaration
Swift
case havePendingNotifications(haveDelayedNotifications: Bool, haveUnreceivedNotifications: Bool)
-
Some messages were deleted
- chatId: Chat identifier
- messageIds: Identifiers of the deleted messages
- isPermanent: True, if the messages are permanently deleted by a user (as opposed to just becoming inaccessible)
- fromCache: True, if the messages are deleted only from the cache and can possibly be retrieved again in the future
Declaration
-
User activity in the chat has changed
- chatId: Chat identifier
- userId: Identifier of a user performing an action
- action: The action description
Declaration
Swift
case userChatAction(chatId: Int53, userId: Int32, action: ChatAction)
-
The user went online or offline
- userId: User identifier
- status: New status of the user
Declaration
Swift
case userStatus(userId: Int32, status: UserStatus)
-
Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the client
- user: New data about the user
Declaration
Swift
case user(user: User)
-
Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the client
- basicGroup: New data about the group
Declaration
Swift
case basicGroup(basicGroup: BasicGroup)
-
Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the client
- supergroup: New data about the supergroup
Declaration
Swift
case supergroup(supergroup: Supergroup)
-
Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the client
- secretChat: New data about the secret chat
Declaration
Swift
case secretChat(secretChat: SecretChat)
-
Some data from userFullInfo has been changed
- userId: User identifier
- userFullInfo: New full information about the user
Declaration
Swift
case userFullInfo(userId: Int32, userFullInfo: UserFullInfo)
-
Some data from basicGroupFullInfo has been changed
- basicGroupId: Identifier of a basic group
- basicGroupFullInfo: New full information about the group
Declaration
Swift
case basicGroupFullInfo(basicGroupId: Int32, basicGroupFullInfo: BasicGroupFullInfo)
-
Some data from supergroupFullInfo has been changed
- supergroupId: Identifier of the supergroup or channel
- supergroupFullInfo: New full information about the supergroup
Declaration
Swift
case supergroupFullInfo(supergroupId: Int32, supergroupFullInfo: SupergroupFullInfo)
-
Service notification from the server. Upon receiving this the client must show a popup with the content of the notification
- type: Notification type. If type begins with “AUTH_KEY_DROP_”, then two buttons “Cancel” and “Log out” should be shown under notification; if user presses the second, all local data should be destroyed using Destroy method
- content: Notification content
Declaration
Swift
case serviceNotification(type: String, content: MessageContent)
-
Information about a file was updated
- file: New data about the file
Declaration
Swift
case file(file: File)
-
The file generation process needs to be started by the client
- generationId: Unique identifier for the generation process
- originalPath: The path to a file from which a new file is generated; may be empty
- destinationPath: The path to a file that should be created and where the new file should be generated
- conversion: String specifying the conversion applied to the original file. If conversion is “#url#” than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by the client
Declaration
Swift
case fileGenerationStart(generationId: TDInt64, originalPath: String, destinationPath: String, conversion: String)
-
File generation is no longer needed
- generationId: Unique identifier for the generation process
Declaration
Swift
case fileGenerationStop(generationId: TDInt64)
-
New call was created or information about a call was updated
- call: New data about a call
Declaration
Swift
case call(call: Call)
-
Some privacy setting rules have been changed
- setting: The privacy setting
- rules: New privacy rules
Declaration
Swift
case userPrivacySettingRules(setting: UserPrivacySetting, rules: UserPrivacySettingRules)
-
Number of unread messages in a chat list has changed. This update is sent only if the message database is used
- chatList: The chat list with changed number of unread messages
- unreadCount: Total number of unread messages
- unreadUnmutedCount: Total number of unread messages in unmuted chats
Declaration
Swift
case unreadMessageCount(chatList: ChatList, unreadCount: Int32, unreadUnmutedCount: Int32)
-
unreadChatCount(chatList:totalCount:unreadCount:unreadUnmutedCount:markedAsUnreadCount:markedAsUnreadUnmutedCount:)
Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used
- chatList: The chat list with changed number of unread messages
- totalCount: Approximate total number of chats in the chat list
- unreadCount: Total number of unread chats
- unreadUnmutedCount: Total number of unread unmuted chats
- markedAsUnreadCount: Total number of chats marked as unread
- markedAsUnreadUnmutedCount: Total number of unmuted chats marked as unread
Declaration
Swift
case unreadChatCount(chatList: ChatList, totalCount: Int32, unreadCount: Int32, unreadUnmutedCount: Int32, markedAsUnreadCount: Int32, markedAsUnreadUnmutedCount: Int32)
-
An option changed its value
- name: The option name
- value: The new option value
Declaration
Swift
case option(name: String, value: OptionValue)
-
The list of installed sticker sets was updated
- isMasks: True, if the list of installed mask sticker sets was updated
- stickerSetIds: The new list of installed ordinary sticker sets
Declaration
Swift
case installedStickerSets(isMasks: Bool, stickerSetIds: [Int64])
-
The list of trending sticker sets was updated or some of them were viewed
- stickerSets: The new list of trending sticker sets
Declaration
Swift
case trendingStickerSets(stickerSets: StickerSets)
-
The list of recently used stickers was updated
- isAttached: True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated
- stickerIds: The new list of file identifiers of recently used stickers
Declaration
Swift
case recentStickers(isAttached: Bool, stickerIds: [Int32])
-
The list of favorite stickers was updated
- stickerIds: The new list of file identifiers of favorite stickers
Declaration
Swift
case favoriteStickers(stickerIds: [Int32])
-
The list of saved animations was updated
- animationIds: The new list of file identifiers of saved animations
Declaration
Swift
case savedAnimations(animationIds: [Int32])
-
The selected background has changed
- forDarkTheme: True, if background for dark theme has changed
- background: The new selected background; may be null
Declaration
Swift
case selectedBackground(forDarkTheme: Bool, background: Background?)
-
Some language pack strings have been updated
- localizationTarget: Localization target to which the language pack belongs
- languagePackId: Identifier of the updated language pack
- strings: List of changed language pack strings
Declaration
Swift
case languagePackStrings(localizationTarget: String, languagePackId: String, strings: [LanguagePackString])
-
The connection state has changed
- state: The new connection state
Declaration
Swift
case connectionState(state: ConnectionState)
-
New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method should be called with the reason “Decline ToS update”
- termsOfServiceId: Identifier of the terms of service
- termsOfService: The new terms of service
Declaration
Swift
case termsOfService(termsOfServiceId: String, termsOfService: TermsOfService)
-
List of users nearby has changed. The update is sent only 60 seconds after a successful searchChatsNearby request
- usersNearby: The new list of users nearby
Declaration
Swift
case usersNearby(usersNearby: [ChatNearby])
-
A new incoming inline query; for bots only
- id: Unique query identifier
- senderUserId: Identifier of the user who sent the query
- userLocation: User location, provided by the client; may be null
- query: Text of the query
- offset: Offset of the first entry to return
Declaration
-
The user has chosen a result of an inline query; for bots only
- senderUserId: Identifier of the user who sent the query
- userLocation: User location, provided by the client; may be null
- query: Text of the query
- resultId: Identifier of the chosen result
- inlineMessageId: Identifier of the sent inline message, if known
Declaration
Swift
case newChosenInlineResult(senderUserId: Int32, userLocation: Location?, query: String, resultId: String, inlineMessageId: String)
-
A new incoming callback query; for bots only
- id: Unique query identifier
- senderUserId: Identifier of the user who sent the query
- chatId: Identifier of the chat where the query was sent
- messageId: Identifier of the message, from which the query originated
- chatInstance: Identifier that uniquely corresponds to the chat to which the message was sent
- payload: Query payload
Declaration
Swift
case newCallbackQuery(id: TDInt64, senderUserId: Int32, chatId: Int53, messageId: Int53, chatInstance: TDInt64, payload: CallbackQueryPayload)
-
A new incoming callback query from a message sent via a bot; for bots only
- id: Unique query identifier
- senderUserId: Identifier of the user who sent the query
- inlineMessageId: Identifier of the inline message, from which the query originated
- chatInstance: An identifier uniquely corresponding to the chat a message was sent to
- payload: Query payload
Declaration
Swift
case newInlineCallbackQuery(id: TDInt64, senderUserId: Int32, inlineMessageId: String, chatInstance: TDInt64, payload: CallbackQueryPayload)
-
A new incoming shipping query; for bots only. Only for invoices with flexible price
- id: Unique query identifier
- senderUserId: Identifier of the user who sent the query
- invoicePayload: Invoice payload
- shippingAddress: User shipping address
Declaration
-
newPreCheckoutQuery(id:senderUserId:currency:totalAmount:invoicePayload:shippingOptionId:orderInfo:)
A new incoming pre-checkout query; for bots only. Contains full information about a checkout
- id: Unique query identifier
- senderUserId: Identifier of the user who sent the query
- currency: Currency for the product price
- totalAmount: Total price for the product, in the minimal quantity of the currency
- invoicePayload: Invoice payload
- shippingOptionId: Identifier of a shipping option chosen by the user; may be empty if not applicable
- orderInfo: Information about the order; may be null
Declaration
-
A new incoming event; for bots only
- event: A JSON-serialized event
Declaration
Swift
case newCustomEvent(event: String)
-
A new incoming query; for bots only
- id: The query identifier
- data: JSON-serialized query data
- timeout: Query timeout
Declaration
Swift
case newCustomQuery(id: TDInt64, data: String, timeout: Int32)
-
A poll was updated; for bots only
- poll: New data about the poll
Declaration
Swift
case poll(poll: Poll)
-
A user changed the answer to a poll; for bots only
- pollId: Unique poll identifier
- userId: The user, who changed the answer to the poll
- optionIds: 0-based identifiers of answer options, chosen by the user
Declaration
Swift
case pollAnswer(pollId: TDInt64, userId: Int32, optionIds: [Int32])