Answer the question
In order to leave comments, you need to log in
How to accept more than one telegram photo?
it is necessary that the telegram bot accept more than one photo on the server and it is necessary to 2 change them with a link to these 2 photos
@bot.message_handler(content_types=['photo'])
def handle_photo(message):
raw = message.photo[2]. file_id
name = raw+".jpg"
file_info = bot.get_file(raw)
downloaded_file = bot.download_file(file_info.file_path)
with open(name,'wb') as new_file:
new_file.write(downloaded_file)
print(name)
if name ==name:
print("jhyjgjy")
raw2 = message.photo[2].file_id
name2 = raw2+".jpg"
file_info = bot.get_file(raw)
downloaded_file = bot.download_file(file_info.file_path)
with open(name2,'wb') as new_file:
new_file.write(downloaded_file)
print(name2)
print(name)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question