Core: Send photo from external URL

Created on 2 May 2017  ·  8Comments  ·  Source: php-telegram-bot/core

Required Information

  • Operating system: Ubuntu 17.04 x64
  • PHP version: 7
  • PHP Telegram Bot version: 0.44.1
  • Using MySQL database: yes
  • Update Method: Webhook
  • Self-signed certificate: no

How can i send photo from external url?

Most helpful comment

That can be done with Telegram's sendPhoto(). More info here: https://core.telegram.org/bots/api#sendphoto

And here's the gist:

$data['photo'] = "http://yoururl";
$data['caption'] = "Photo caption";
return Request::sendPhoto($data);

All 8 comments

That can be done with Telegram's sendPhoto(). More info here: https://core.telegram.org/bots/api#sendphoto

And here's the gist:

$data['photo'] = "http://yoururl";
$data['caption'] = "Photo caption";
return Request::sendPhoto($data);

@haiksu Thank you so much friend. :+1:

for send photo by screen shot web pages can it?

@rikyminarki If you're asking about attaching a file via sendPhoto:

Request::sendPhoto([
    'chat_id' => $chat_id,
    'photo'   => Request::encodeFile($path_to_local_file),
]);

Telegram bot can't make and send screenshots, you would need an external tool for that.

so, i must used external tool, ex wkhtmltopdf ot wktmltoimage

2018-01-16 16:01 GMT+07:00 Armando Lüscher notifications@github.com:

@rikyminarki https://github.com/rikyminarki If you're asking about
attaching a file via sendPhoto:

Request::sendPhoto([ 'chat_id' => $chat_id, 'photo' => Request::encodeFile($path_to_local_file),]);

Telegram bot can't make and send screenshots, you would need an external
tool for that.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/php-telegram-bot/core/issues/489#issuecomment-357894915,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AfGBdKzV7U1yRTv9MR5e1UANQhBnSlb4ks5tLGVvgaJpZM4NOYTM
.

Yes, that would be the easiest solution I think 👍

can you help me to create a sample command (/) for sending images but
through the url?
I'm looking for how to make it but I do not think I can,
I will pay after I can make it
19 Jan 2018 02.35, "Armando Lüscher" notifications@github.com menulis:

Yes, that would be the easiest solution I think 👍


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/php-telegram-bot/core/issues/489#issuecomment-358755777,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AfGBdCTjMDVLg9horUwSo5SEXcCP7oUSks5tL5uagaJpZM4NOYTM
.

@rikyminarki Get in touch with me on Telegram directly: https://t.me/noplanman

Was this page helpful?
0 / 5 - 0 ratings