T
T
thisall2020-12-19 16:33:34
Bots
thisall, 2020-12-19 16:33:34

How to send album using sendMediaGroup Telegram bot on Laravel?

foreach ($photos as $photo) {
            $media[] = [
                'type' => 'photo',
                'media' => InputFile::create("https://domen.ru/{$photo}"),
            ];
        }

        Telegram::sendMediaGroup([
            'chat_id' => $chat_id,
            'media' => $media
        ]);

It works with one file, but if I want to send an album, I get such an error (
A path to local file, a URL, or a file resource should be uploaded using `Telegram\Bot\FileUpload\InputFile::create($pathOrUrlOrResource, $filename)` for `media` property. Please view docs for example.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question