N
N
New Oblachko2020-06-19 21:26:35
Python
New Oblachko, 2020-06-19 21:26:35

How to make a telegram bot send photos and text with a minimum number of Python commands?

I'm making a telegram bot on telegramBotApi (in Python) and I need the bot to send a jpg file and a text message. Thanks to those who answer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
selfkilla666, 2020-06-21
@Yn1wertyk

with open('Ваш путь к картинке', 'rb') as photo:
    bot.send_photo(chat_id, photo = photo, caption = 'Подпись к вашему изображению (не обязательно)')

In general, there is already a similar question, with a ready-made solution

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question