Chat
public struct Chat : Codable, Equatable, FunctionResult
A chat. (Can be a private chat, basic group, supergroup, or secret chat)
-
Chat unique identifier
Declaration
Swift
public let id: Int53 -
Type of the chat
Declaration
Swift
public let type: ChatType -
A chat list to which the chat belongs; may be null
Declaration
Swift
public let chatList: ChatList? -
Chat title
Declaration
Swift
public let title: String -
Chat photo; may be null
Declaration
Swift
public let photo: ChatPhoto? -
Actions that non-administrator chat members are allowed to take in the chat
Declaration
Swift
public let permissions: ChatPermissions -
Last message in the chat; may be null
Declaration
Swift
public let lastMessage: Message? -
Descending parameter by which chats are sorted in the main chat list. If the order number of two chats is the same, they must be sorted in descending order by ID. If 0, the position of the chat in the list is undetermined
Declaration
Swift
public let order: TDInt64 -
True, if the chat is pinned
Declaration
Swift
public let isPinned: Bool -
True, if the chat is marked as unread
Declaration
Swift
public let isMarkedAsUnread: Bool -
True, if the chat is sponsored by the user’s MTProxy server
Declaration
Swift
public let isSponsored: Bool -
True, if the chat has scheduled messages
Declaration
Swift
public let hasScheduledMessages: Bool -
True, if the chat messages can be deleted only for the current user while other users will continue to see the messages
Declaration
Swift
public let canBeDeletedOnlyForSelf: Bool -
True, if the chat messages can be deleted for all users
Declaration
Swift
public let canBeDeletedForAllUsers: Bool -
True, if the chat can be reported to Telegram moderators through reportChat
Declaration
Swift
public let canBeReported: Bool -
Default value of the disable_notification parameter, used when a message is sent to the chat
Declaration
Swift
public let defaultDisableNotification: Bool -
Number of unread messages in the chat
Declaration
Swift
public let unreadCount: Int32 -
Identifier of the last read incoming message
Declaration
Swift
public let lastReadInboxMessageId: Int53 -
Identifier of the last read outgoing message
Declaration
Swift
public let lastReadOutboxMessageId: Int53 -
Number of unread messages with a mention/reply in the chat
Declaration
Swift
public let unreadMentionCount: Int32 -
Notification settings for this chat
Declaration
Swift
public let notificationSettings: ChatNotificationSettings -
Describes actions which should be possible to do through a chat action bar; may be null
Declaration
Swift
public let actionBar: ChatActionBar? -
Identifier of the pinned message in the chat; 0 if none
Declaration
Swift
public let pinnedMessageId: Int53 -
Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
Declaration
Swift
public let replyMarkupMessageId: Int53 -
A draft of a message in the chat; may be null
Declaration
Swift
public let draftMessage: DraftMessage? -
Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if the message database is used
Declaration
Swift
public let clientData: String -
init(id:type:chatList:title:photo:permissions:lastMessage:order:isPinned:isMarkedAsUnread:isSponsored:hasScheduledMessages:canBeDeletedOnlyForSelf:canBeDeletedForAllUsers:canBeReported:defaultDisableNotification:unreadCount:lastReadInboxMessageId:lastReadOutboxMessageId:unreadMentionCount:notificationSettings:actionBar:pinnedMessageId:replyMarkupMessageId:draftMessage:clientData:)A chat. (Can be a private chat, basic group, supergroup, or secret chat)
Declaration
Swift
public init(id: Int53, type: ChatType, chatList: ChatList?, title: String, photo: ChatPhoto?, permissions: ChatPermissions, lastMessage: Message?, order: TDInt64, isPinned: Bool, isMarkedAsUnread: Bool, isSponsored: Bool, hasScheduledMessages: Bool, canBeDeletedOnlyForSelf: Bool, canBeDeletedForAllUsers: Bool, canBeReported: Bool, defaultDisableNotification: Bool, unreadCount: Int32, lastReadInboxMessageId: Int53, lastReadOutboxMessageId: Int53, unreadMentionCount: Int32, notificationSettings: ChatNotificationSettings, actionBar: ChatActionBar?, pinnedMessageId: Int53, replyMarkupMessageId: Int53, draftMessage: DraftMessage?, clientData: String)Parameters
idChat unique identifier
typeType of the chat
chatListA chat list to which the chat belongs; may be null
titleChat title
photoChat photo; may be null
permissionsActions that non-administrator chat members are allowed to take in the chat
lastMessageLast message in the chat; may be null
orderDescending parameter by which chats are sorted in the main chat list. If the order number of two chats is the same, they must be sorted in descending order by ID. If 0, the position of the chat in the list is undetermined
isPinnedTrue, if the chat is pinned
isMarkedAsUnreadTrue, if the chat is marked as unread
isSponsoredTrue, if the chat is sponsored by the user’s MTProxy server
hasScheduledMessagesTrue, if the chat has scheduled messages
canBeDeletedOnlyForSelfTrue, if the chat messages can be deleted only for the current user while other users will continue to see the messages
canBeDeletedForAllUsersTrue, if the chat messages can be deleted for all users
canBeReportedTrue, if the chat can be reported to Telegram moderators through reportChat
defaultDisableNotificationDefault value of the disable_notification parameter, used when a message is sent to the chat
unreadCountNumber of unread messages in the chat
lastReadInboxMessageIdIdentifier of the last read incoming message
lastReadOutboxMessageIdIdentifier of the last read outgoing message
unreadMentionCountNumber of unread messages with a mention/reply in the chat
notificationSettingsNotification settings for this chat
actionBarDescribes actions which should be possible to do through a chat action bar; may be null
pinnedMessageIdIdentifier of the pinned message in the chat; 0 if none
replyMarkupMessageIdIdentifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
draftMessageA draft of a message in the chat; may be null
clientDataContains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if the message database is used
View on GitHub
Install in Dash
Chat Structure Reference