1

When I try to send a photo or video using its link in telegram-bot-sdk package, I get the following error: I also use the latest version of the package (version 3).

A path to local file, a URL, or a file resource should be uploaded using 'Telegram\Bot\FileUpload\InputFile::create($pathOrUrlOrResource, $filename)' for 'photo' property. Please view docs for example.

my code:

$telegram = new Api($bot_token);
    $telegram->sendPhoto([
        'chat_id' => '533787134',
        'photo' => 'https://telegram-bot-sdk.com/img/hero-banner.png',
        'caption' => 'Some caption'
    ]);
mr-mr7
  • 11
  • 1

0 Answers0