Answer the question
In order to leave comments, you need to log in
How to send a photo with pyTelegramBotAPI bot?
Hello!
I understand Python and in parallel for practice I sculpt a bot for Telegram using pyTelegramBotAPI.
The idea is as follows: the bot polls the user with a bunch of questions, asks for a picture, then generates them all as a whole, sends them to me for approval and, if approved, sends them to the channel.
There are no problems with text messages, but there is no way to do this with an image. Below is a piece of code:
def photo_found(message):
photo_dog = message.photo[-1].file_id
bot.send_photo(message.from_user.id, photo_dog, caption='Вот ваша картинка')
bot.send_message(chat_id=[Тут мой ID в Telegram], text='Пользователь хочет разместить следующее объявление: ')
bot.send_photo(chat_id=[Тут мой ID в Telegram], photo_dog)
Answer the question
In order to leave comments, you need to log in
Positional argument after keyword argument
bot.send_photo([Тут мой ID в Telegram], photo_dog)
bot.send_photo(chat_id=[Тут мой ID в Telegram], photo=photo_dog)
bot.send_photo([Тут мой ID в Telegram], photo=photo_dog)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question