Skip to content

Fix upload and download files

Compare
Choose a tag to compare
@Mateodioev Mateodioev released this 02 Dec 16:32
· 0 commits to main since this release

You can use this sintax to download telegram files

$api->downloadFile($file, __DIR__ . '/my-file');

Where $file is a Mateodioev\Bots\Telegram\Types\File instance

For upload files you need to use the Mateodioev\Bots\Telegram\Types\InputFile object like this

$api->sendDocument('CHAT_ID', InputFile::fromLocal('/path/to/document'));
$api->sendPhoto('CHAT_ID', InputFile::fromLocal('/path/to/photo.jpg'));

For send multiple files use Core::sendMediaGroup method

See more example in examples/sending-files.php

Full Changelog: v4.3.4.1...v4.3.5