N
N
NOblo2020-06-20 18:38:02
Python
NOblo, 2020-06-20 18:38:02

How to send a message with a photo in the TG bot?

I need the bot to send text + image, how to do it?
Type

bot.send_message(id, "text") + bot.send_message(id, #photo )


To attach text to an image? Well, or give a link to this section in the api telegram docks, please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
del4pp, 2020-06-20
@NOblo

img = open('image path', 'rb')
bot.send_photo(id, photo=img, caption='caption')
img.close()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question