I need send an image url to telegram without display image url and hidden url. I see a telegram bot and it's do it very well and send long message with image I'm attach this bot result image see it. Now how can do it in my custom bot? It's possible hidden url with MARKDOWN style or any way? I want hidden image url in my text but telegram display my image. see my sample attach image. thank you
8 Answers
Most of them use the dot (or some things like this character) for link description and you thought there is no link.
You can type the following line and select custom markdown
:
@bold [.](http://www.planwallpaper.com/static/images/i-should-buy-a-boat.jpg)
If you want to add text to your link, you need to create a bot and use this approach in the bot.
Edit:
For sending hyperlink with the bot api you can simply send html markup and using parse_mode
. See telegram documents:
To use this mode, pass HTML in the parse_mode field when using sendMessage. The following tags are currently supported:
<b>bold</b>, <strong>bold</strong>
<i>italic</i>, <em>italic</em>
<a href="http://www.example.com/">inline URL</a>
<a href="tg://user?id=123456789">inline mention of a user</a>
<code>inline fixed-width code</code>
<pre>pre-formatted fixed-width code block</pre>
sample:
<a href="http://www.planwallpaper.com/static/images/i-should-buy-a-boat.jpg"></a>

- 3,343
- 3
- 35
- 54
-
1Thank you dear Naser Yousefi I'm using dot before but I see a bot without using dot or any character and display image with long message I don't know how do it – Matin Sep 20 '16 at 20:28
-
1You can use a persian bot in telegram named @AxNegarBot. simply send an image to it and then reply that image and send your long text. – n.y Sep 21 '16 at 05:12
-
1Thank you Dear Naser Yousefi I'm see Persian bot it's very good I want created my custom bot and do it I need this code. can you help me? – Matin Sep 21 '16 at 22:48
According to the Telegram API, it seems if you set disable_web_page_preview
to true
, you should get the result you want.
The final message should look something like this:
{
chat_id: 1235,
message: "http://your/url",
disable_web_page_preview: true,
}
EDIT: It seems I misunderstood the question, and you actually want the image to appear by itself rather than the url by itself.
Again, as per the Telegram API you can send an image directly. But as far as I can tell, you can't use a URL to do it. You would have to upload the photo from your telegram server directly. You could use the caption
property to send text with it.
Here is an example of how you might be able do this in python. You will need to tweak this to whichever language you are using, but the concept is the same.
import requests
response = requests.post(
"https://your.bot.url.com/sendPhoto",
data={
"chat_id": 1234,
"caption": "Your extra text here"
}
files={
"photo": (
"image_name.jpg",
"contents of image",
"image/jpg",
{},
)
}
)
The caption
property has a limit of 200 characters, so if you want to send more characters then that, you'll have to send two messages.
You can always ask Telegram to add this type of functionality in the future

- 8,749
- 4
- 47
- 57
-
1thank you but my problem is not disable_web_page_preview I need hidden url when send for example http://i.stack.imgur.com/BWjTS.png to telegram only display image not display url – Matin Sep 19 '16 at 23:35
-
-
1I need send long text with image if I can send image without display image url I can send my text and image. It's my demo result: http://i.stack.imgur.com/BWjTS.png – Matin Sep 19 '16 at 23:39
-
1image caption is very limited I can send image and caption with php but I need another program If you see this bot https://telegram.me/AxNegarBot it's send image with 4000 character I need it in my program this bot hidden image url but display image – Matin Sep 19 '16 at 23:55
-
In that case I suggest you send two messages - the image with no caption, and a normal message just before/after it. You cannot send them at the same time. – Shadow Sep 20 '16 at 00:21
-
-
The sample bot seems to use a caption. If you can't use a caption because of its limited length, you have to send two messages. – Shadow Sep 20 '16 at 00:35
The answer is zero-width non-joiner (ZWNJ) character. ZWNJ is encoded in Unicode as U+200C ZERO WIDTH NON-JOINER
(HTML ‌
, ‌
).
HTML mode:
<a href="https://example.com">‌</a>
MARKDOWN mode:
[](https://example.com)
Update 2021:
The answer is still working but telegram doesn't let you send an empty text message that include only this character anymore, so you have to add at least one character in the whole text message. In addition you can also use the character Unicode Character 'WORD JOINER' (U+2060) instead.

- 167
- 1
- 9
-
-
I'm trying to use it in PHP, but is not working. The POST return with 'bad request'. – Bruno Yuzo Jan 27 '21 at 14:49
-
There is a hidden character in between brackets, you can copy and use it. – Mehdi Rahimi Jan 28 '21 at 15:27
You can use  
character as hidden character.

- 2,434
- 1
- 27
- 33
-
This actually has the effect of rendering a space (it's the same as writing ` `), but it works – mcont Aug 19 '18 at 08:15
import requests
def telegram(channel,bot,text,img):
if(text==""):text="Refer - "
r = requests.get('https://api.telegram.org/bot'+bot+'/sendMessage?chat_id=@'+channel+'&parse_mode=markdown&text='+"[]("+img+")"+text)
Use the above function. It will work perfectly. In case, there is no text and only image, it should break. So it will show a "." (dot) in those cases.
Now use the function -
telegram(your_channel_name,your_token_here,description,image_url)

- 1,500
- 13
- 18
To correctly send an image hosted on a website without showing any reference link, you must use the "html" parsing mode.
And in the content to send, for example, something like this (Python mode):
# We take the html address of the image.
image_address = 'https://picsum.photos/100.jpg'
# The unicode character to prevent the words from
# being separated, in this case, we take advantage
# of it so that the Telegram API accepts it and
# incidentally so that it does not take up space
# when including text in the message.
word_joiner = '⁠'
# This would be the final pattern.
html_pattern = f'<a href="{image_address}">{word_joiner}</a>'

- 30,962
- 25
- 85
- 135

- 1
- 2
With HTML
parse mode. Keep empty space between the opening and closing tag.
<a href="https://t.me/"> </a>

- 3,888
- 1
- 31
- 37