A photo

Hierarchy (View Summary)

Constructors

Properties

dcId?: number

DC ID of the file, when available

fileSize?: number

File size in bytes, when available

height: number

Biggest available photo height

location:
    | Uint8Array
    | TypeInputFileLocation
    | TypeInputWebFileLocation
    | () => Uint8Array | TypeInputFileLocation | TypeInputWebFileLocation

Location of the file.

Either a TL object declaring remote file location, a Buffer containing actual file content (for stripped thumbnails and vector previews), or a function that will return either of those.

When a function is passed, it will be lazily resolved the first time downloading the file.

type: "photo" = ...
width: number

Biggest available photo width

Accessors

  • get date(): Date
  • Date this photo was sent

    Returns Date

  • get fileId(): string
  • Get TDLib and Bot API compatible File ID representing this photo's best thumbnail.

    Returns string

  • get hasSpoiler(): boolean
  • Whether this photo is hidden with a spoiler

    Returns boolean

  • get id(): Long
  • Photo ID

    Returns Long

  • get inputPhoto(): TypeInputPhoto
  • Input photo generated from this object.

    Returns TypeInputPhoto

  • get isAnimatedAvatar(): boolean
  • Whether this photo is an animated profile picture

    Returns boolean

  • get isMarkupAvatar(): boolean
  • Whether this photo is an animated profile picture, built from an emoji/sticker markup

    Returns boolean

  • get thumbnails(): readonly Thumbnail[]
  • Available thumbnails.

    Note: This list will also contain the largest thumbnail that is represented by the current object.

    Returns readonly Thumbnail[]

  • get ttlSeconds(): null | number
  • For self-destructing photos, TTL in seconds

    Returns null | number

  • get uniqueFileId(): string
  • Get TDLib and Bot API compatible Unique File ID representing this photo's best thumbnail.

    Returns string

Methods

  • Get a photo thumbnail by its type.

    Thumbnail types are described in the Telegram docs, and are also available as static members of Thumbnail for convenience.

    Parameters

    • type: string

      Thumbnail type

    Returns null | Thumbnail