@bot.message_handler(content_types=['photo'])
def handle_docs_document(message):
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/Desktop/bot2.0/photo' + message.photo[1].file_id
with open(src, 'wb') as new_file:
new_file.write(downloaded_file)
bot.reply_to(message, "Фото добавлено")
from pathlib import Path
my_folder_path = Path('/home/pi/Desktop/bot2.0/photo')
my_file_path = my_folder_path / 'my_file_name.ext'
print(f'Для ясности можно залогировать путь по которому сохраняем: {my_file_path}')
my_file_path.write_bytes(downloaded_file)