C
C
cehka2018-02-01 20:24:47
Python
cehka, 2018-02-01 20:24:47

Telegram API, throw a picture with a link, but don't show the link, how?

Is it possible to throw a picture with a link, for example

https://pp.userapi.com/c841220/v841220591/667c8/16VMgxEjb94.jpg

and at the output just get a picture in the chat?
The link is thrown by the bot via send_message.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
X
xdgadd, 2018-02-02
@xdgadd

Just wrap the image in a tag <a>and add &#8203;it as text. Then the picture will be sent without a visible link:

bot.send_message(id, '<a href="IMG_URL">&#8203;</a>', parse_mode="HTML")

A
arynyklas, 2019-11-15
@arynyklas

Solution to your problem: instead of send_message send_photo

bot.send_photo(message.chat.id, 'https://pp.userapi.com/c841220/v841220591/667c8/16VMgxEjb94.jpg')

A
Akcent Goncesta, 2018-02-02
@Akcent

Заверни картинку в ссылку . И отправляй как текст с параметром parse_mode = "HTML".
text ='<a href="https://pp.userapi.com/c841220/v841220591/667c8/16VMgxEjb94.jpg" >Любое название </a>'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question