Skip to main content

Download Files

Since each request like $bot->method([]) is made using the /bot{TOKEN}/{method} endpoint, the library provides a method to download files with /file/bot{TOKEN}/{PATH}.


// Assuming you have a bot instance named $bot
if($bot->downloadFile('path given by /getFile', '/path/to/downloads')){
echo 'The download was successfull';
} else {
echo 'There was an error';

See /getFile to know the path of the downloadable file.