Skip to content

export Class

FormDataBuilder ​

extends ​

Builder

FormData as a builder for sending files.

Constructor ​

ts
 new FormDataBuilder( ...append_datas )
ParameterTypeDescription
...append_datasFormAppendData[]An array of FormAppendData to append to the form.

Methods ​

append( file ) ​

ParameterTypeDescription
fileFileThe class File with an attached file to append to the form..

Append a file to the form.

Returns: this

append( name, path, options ) ​

ParameterTypeDescription
namestringThe name the file will be attached as.
pathstring | "fs".ReadStreamAbsolute path to the file or a ReadStream.
options?string | FormData.AppendOptionsAdditional options or the name of the file.

Append a file to the form with a name, path or a read stream, and append options.

Returns: this

A modern, powerful library for building your Telegram bots, with seamless support for both JavaScript and Typescript.