Chat

public struct Chat : Codable, Equatable, FunctionResult

A chat. (Can be a private chat, basic group, supergroup, or secret chat)

  • id

    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
  • 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

    id

    Chat unique identifier

    type

    Type of the chat

    chatList

    A chat list to which the chat belongs; may be null

    title

    Chat title

    photo

    Chat photo; may be null

    permissions

    Actions that non-administrator chat members are allowed to take in the chat

    lastMessage

    Last message in the chat; may be null

    order

    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

    isPinned

    True, if the chat is pinned

    isMarkedAsUnread

    True, if the chat is marked as unread

    isSponsored

    True, if the chat is sponsored by the user’s MTProxy server

    hasScheduledMessages

    True, if the chat has scheduled messages

    canBeDeletedOnlyForSelf

    True, if the chat messages can be deleted only for the current user while other users will continue to see the messages

    canBeDeletedForAllUsers

    True, if the chat messages can be deleted for all users

    canBeReported

    True, if the chat can be reported to Telegram moderators through reportChat

    defaultDisableNotification

    Default value of the disable_notification parameter, used when a message is sent to the chat

    unreadCount

    Number of unread messages in the chat

    lastReadInboxMessageId

    Identifier of the last read incoming message

    lastReadOutboxMessageId

    Identifier of the last read outgoing message

    unreadMentionCount

    Number of unread messages with a mention/reply in the chat

    notificationSettings

    Notification settings for this chat

    actionBar

    Describes actions which should be possible to do through a chat action bar; may be null

    pinnedMessageId

    Identifier of the pinned message in the chat; 0 if none

    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

    draftMessage

    A draft of a message in the chat; may be null

    clientData

    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