Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send video via telegram bot #103

Closed
Odilbukh opened this issue Dec 24, 2021 · 1 comment
Closed

How to send video via telegram bot #103

Odilbukh opened this issue Dec 24, 2021 · 1 comment

Comments

@Odilbukh
Copy link

Odilbukh commented Dec 24, 2021

  • BotMan Version: 2.0
  • PHP Version: 7.4
  • Messaging Service(s): Telegram
  • Cache Driver: Laravel

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
Copy link
Contributor

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants