A dialog.

Think of it as something that is listed in Telegram's main window.

Constructors

Properties

_messages: Map<number, TypeMessage>
_peers: PeersIndex

Accessors

  • get draftMessage(): null | DraftMessage
  • Draft message in this dialog

    Returns null | DraftMessage

  • get isArchived(): boolean
  • Whether this dialog is archived

    Returns boolean

  • get isManuallyUnread(): boolean
  • Whether this chat was manually marked as unread

    Returns boolean

  • get isMuted(): null | boolean
  • Whether this dialog is muted.

    If null, the default account-level setting should be used.

    Returns null | boolean

  • get isPinned(): boolean
  • Whether this dialog is pinned

    Returns boolean

  • get isUnread(): boolean
  • Whether this chat should be considered unread (i.e. has more than 1 unread message, or has a "manually unread" mark)

    Returns boolean

  • get lastMessage(): null | Message
  • The latest message sent in this chat (if any)

    Returns null | Message

  • get lastRead(): number
  • ID of the last read message in this dialog

    Returns number

  • get lastReadIngoing(): number
  • ID of the last read ingoing message in this dialog

    Returns number

  • get lastReadOutgoing(): number
  • ID of the last read outgoing message in this dialog

    Returns number

  • get peer(): Peer
  • Peer that this dialog represents

    Returns Peer

  • get ttlPeriod(): null | number
  • TTL period of all messages in this dialog

    Returns null | number

  • get unreadCount(): number
  • Number of unread messages

    Returns number

  • get unreadMentionsCount(): number
  • Number of unread mentions

    Returns number

  • get unreadReactionsCount(): number
  • Number of unread reactions

    Returns number

Methods

  • Create a filter predicate for the given Folder. Returned predicate can be used in Array.filter()

    Parameters

    • folder: TypeDialogFilter

      Folder to filter for

    • excludePinned: boolean = true

      Whether to exclude pinned folders

    Returns (val: Dialog) => boolean

  • Find pinned dialogs from a list of dialogs

    Parameters

    • dialogs: Dialog[]

      Dialogs list

    • Optionalfolder: RawDialogFilter

      If passed, status of pin will be checked against this folder, and not globally

    Returns Dialog[]

  • Parse a list of dialogs from a TL object

    Parameters

    Returns Dialog[]