Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SendFileInterface

Interface for sending files to a chat.

Hierarchy

  • SendFileInterface

Index

Properties

file: FileLike | FileLike[]

a file like object.

  • can be a localpath. the file name will be used.
  • can be a Buffer with a ".name" attribute to use as the file name.
  • can be an external direct URL. Telegram will download the file and send it.
  • can be an existing media from another message.
  • can be a handle to a file that was received by using uploadFile
  • can be a list when using an album
  • can be Api.TypeInputMedia instance. For example if you want to send a dice you would use Api.InputMediaDice
caption?: string | string[]

Optional caption for the sent media message. can be a list for albums

forceDocument?: boolean

If left to false and the file is a path that ends with the extension of an image file or a video file, it will be sent as such. Otherwise always as a document.

fileSize?: number

The size of the file to be uploaded if it needs to be uploaded, which will be determined automatically if not specified.

clearDraft?: boolean

Whether the existing draft should be cleared or not.

progressCallback?: OnProgress

progress callback that will be called each time a new chunk is downloaded.

replyTo?: MessageIDLike

Same as replyTo from {@link sendMessage}.

Optional attributes that override the inferred ones, like Api.DocumentAttributeFilename and so on.

thumb?: FileLike

Optional JPEG thumbnail (for documents). Telegram will ignore this parameter unless you pass a .jpg file!
The file must also be small in dimensions and in disk size. Successful thumbnails were files below 20kB and 320x320px.
Width/height and dimensions/size ratios may be important. For Telegram to accept a thumbnail, you must provide the dimensions of the underlying media through attributes: with DocumentAttributesVideo.

voiceNote?: boolean

If true the audio will be sent as a voice note.

videoNote?: boolean

If true the video will be sent as a video note, also known as a round video message.

supportsStreaming?: boolean

Whether the sent video supports streaming or not.
Note that Telegram only recognizes as streamable some formats like MP4, and others like AVI or MKV will not work.
You should convert these to MP4 before sending if you want them to be streamable. Unsupported formats will result in VideoContentTypeError.

parseMode?: any

See the parseMode property for allowed values. Markdown parsing will be used by default.

formattingEntities?: TypeMessageEntity[]

A list of message formatting entities. When provided, the parseMode is ignored.

silent?: boolean

Whether the message should notify people in a broadcast channel or not. Defaults to false, which means it will notify them. Set it to True to alter this behaviour.

scheduleDate?: number

If set, the file won't send immediately, and instead it will be scheduled to be automatically sent at a later time.

buttons?: MarkupLike

The matrix (list of lists), row list or button to be shown after sending the message.
This parameter will only work if you have signed in as a bot. You can also pass your own ReplyMarkup here.

workers?: number

How many workers to use to upload the file. anything above 16 is unstable.

noforwards?: boolean
commentTo?: number | Message

Similar to replyTo, but replies in the linked group of a broadcast channel instead (effectively leaving a "comment to" the specified message).

This parameter takes precedence over replyTo. If there is no linked chat, SG_ID_INVALID is thrown.

topMsgId?: number | Message

Used for threads to reply to a specific thread

Generated using TypeDoc