Using Telegram Bot API,
I\'m aware that it is possible to send an image via https://core.telegram.org/bots/api#sendphoto
However, how can I embed a remote im
you must set ParseMode in HTML and set your Image Url in A tag like this:
<a href="' + image + '">‍</a>
‍
-> never show in message
Method using http://.......jpg>.. will show preview of the image below the text. Like this:
a href sample
It will look better if you send an image with a caption.
caption sample
You can use zero-width space trick. Works for both Markdown and HTML parse mode.
Markdown:
$data = [
'chat_id' => $chat_id,
'parse_mode' => 'markdown',
'text' => "[](https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Stack_Overflow_logo.svg/200px-Stack_Overflow_logo.svg.png) Some text here.",
];
Result:
Note: The zero-width space is in-between the brackets "[]".
import requests
text="testing"
img="http://imageurl.png"
r = requests.get('https://api.telegram.org/botyour_token_here/sendMessage?chat_id=@your_channel_here&parse_mode=markdown&text='+"[]("+img+")"+text)