Type Alias InputFileLike

InputFileLike:
    | UploadFileLike
    | UploadedFile
    | tl.TypeInputFile
    | tl.TypeInputMedia
    | RawFullRemoteFileLocation

Describes types that can be used as an input to any methods that send media (like TelegramClient.sendPhoto)

Can be one of:

  • Buffer, which will be interpreted as raw file contents
  • File (from the Web API)
  • ReadStream (for Node.js/Bun, from the fs module)
  • ReadableStream (from the Web API, base readable stream)
  • Readable (for Node.js/Bun, base readable stream)
  • BunFile (from Bun.file())
  • Deno.FsFile (from Deno.open() in Deno)
  • UploadedFile returned from TelegramClient.uploadFile
  • tl.TypeInputFile and tl.TypeInputMedia TL objects
  • string with a path to a local file prepended with file: (non-browser only) (e.g. file:image.jpg)
  • string with a URL to remote files (e.g. https://example.com/image.jpg)
  • string with TDLib and Bot API compatible File ID.
  • URL (from the Web API, will be fetch()-ed if needed; file:// URLs are not available in browsers)
  • td.RawFullRemoteFileLocation (parsed File ID)