Подскажите. Как получить подпись с картинки, отправленной в бот?
Не могу понять. Спасибо.
@bot.message_handler (Content_Types = [ 'фото'])
def handle_docs_photo (message):
попробовать:
chat_id = message.chat.id
text = message.text
vid_id = message.chat.first_name
file_info = bot.get_file(message.photo[len(message.photo)-1].file_id)
downloaded_file = bot.download_file(file_info.file_path)
src='/home/pi/test/'+file_info.file_path;
with open(src, 'wb') as new_file:
new_file.write(downloaded_file)
bot.reply_to(message,"Foto add")
img = open(src, 'rb')
bot.send_photo(adminid, img)
keyboard = types.InlineKeyboardMarkup(row_width=1)
callback_bad = types.InlineKeyboardButton(text="KILL", callback_data='story[!!!]'+str(file_info.file_path))
keyboard.add(callback_bad)
bot.send_message(adminid,"Add: "+vid_id , reply_markup=keyboard)
except Exception as e:
bot.send_message(adminid, e)