File Upload Methods
In Bots Limited (BLP), you can send media in three different ways:- By URL: Provide a direct HTTP/HTTPS URL. Telegram will download and send the file.
- By File ID: If the file is already on Telegram’s servers, use its
file_id. - By InputFile (Raw Bytes): Use the
User.getDataFile()or similar export methods to upload raw files dynamically from your backend.
Sending Media
sendPhoto
Use this method to send photos.BLP Example
BLP Example
sendAudio
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format.BLP Example
sendDocument
Use this method to send general files.BLP Example
InputFile:
BLP Example
sendVideo
Use this method to send video files, Telegram clients support MP4 videos.BLP Example
sendAnimation
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).BLP Example
sendVoice
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. The audio must be in an .OGG file encoded with OPUS.BLP Example
sendVideoNote
Use this method to send video messages. Telegram clients display these as rounded, square-cropped videos of up to 1 minute long.BLP Example
sendMediaGroup
Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type.BLP Example
Editing Media
editMessageMedia
Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise.BLP Example