I’m on a channel that sends messages that contains a text, with a link (that link has not an image) and an image (tip product from amazon):
I tried with this code and it’s similar:
bot.telegram.sendMessage('mychannel', `Hello https:/path/to/image.jpg`)
And it works it similar, but it remains the link. SO how can i put that way with image preview but not the link?
Thank you
2
Answers
There is no way to send a preview without a link. You can try to have some by your own telegram account and you will see it is impossible.
Instead of preview, add some caption to photos.
One workaround(trick) would be to insert the link but use an empty character unicode (like from https://emptycharacter.com/)
Here is an example (I inserted the photo URL with an empty character)
some sample code to get you started:
Here we just create a new function
getHiddenLink()
that accepts the URL and parse_mode (HTML or markdown) and just craft a new URL representation with the empty character as the link-text and return it.