botman / driver-telegram

BotMan Telegram Driver
MIT License
86 stars 75 forks source link

How to send video via telegram bot #103

Closed Odilbukh closed 2 years ago

Odilbukh commented 2 years ago

Description:

How to send video via telegram bot to user. Please help I installed Telegram driver on to BotManStudio. It works good! But I can't send video to user via telegram bot

I tried this. But it does not work

$attachment = new Video($url);
    $message = OutgoingMessage::create()->withAttachment($attachment);

   $bot->reply($message);

Steps To Reproduce:

filippotoso commented 2 years ago

I just tested this code and it works perfectly:

// Create attachment
$attachment = new Video('https://download.samplelib.com/mp4/sample-5s.mp4', [
    'custom_payload' => true,
]);

// Build message object
$message = OutgoingMessage::create('This is a test')
    ->withAttachment($attachment);

$bot->reply($message);