Skip to content
Mahdi Dibaiee edited this page Jul 3, 2015 · 1 revision

File

Sends a file, can be a photo, video, audio or any other type (document).

The file type is automatically determined the best fitting method is chosen. If you provide a second argument fileType, the first argument is treated as a file_id instead of path.

Here is the chainable method equivalent of each option:

  • to => chat_id
  • file => photo/video/audio/document
  • caption => caption
  • reply => reply_to_message_id
  • keyboard => reply_markup
const file = new File()
                  .file('./test.png')
                  .caption('This is a test');
bot.send(file);
Clone this wiki locally