How to take a few photos?

Want to take n pictures from messages and save them under the id telegram user. All gut, but still works with the 1st photo. Loaded 10 pictures, and it gets them asynchronously. I uploaded 10 pictures and in the method photo_make_photo_step I see only 2pieces, as the other had not been uploaded yet. How to get around it? Library pytelegrambotapi

msg = bot.send_message(message.chat.id 'Take photos. As complete - click Next⏭ app', reply_markup = ok_cancel_menu)
 bot.register_next_step_handler(msg, photo_make_photo_step)

def photo_make_photo_step(message):

 if message.content_type=='photo':
 fileID = message.photo[-1].file_id
 file_info = bot.get_file(fileID)
 downloaded_file = bot.download_file(file_info.file_path)

 with open(fileID+".jpg", 'wb') as new_file:
new_file.write(downloaded_file)
user.photos.append(fileID+".jpg")
 msg = bot.send_message(message.chat.id, 'Add more photos or click Next if finished selection')
 bot.register_next_step_handler(msg, photo_bind_photo_step)
return
 msg = bot.send_message(message.chat.id, 'Enter object number', reply_markup = cancel_menu)
 bot.register_next_step_handler(msg, vvedi_nomer_objecta_step)
April 7th 20 at 15:37
0 answer

Find more questions by tags Python