Answer the question
In order to leave comments, you need to log in
How to save a photo sent to a telebot bot?
I need the bot to which the user sends a photo to save it in a folder and give it a name, please tell me how can this be done ???
Answer the question
In order to leave comments, you need to log in
There is such a thing as documentation, because there are similar examples.
Why can't you google?
file_info = bot.get_file(message.document.file_id)
downloaded_file = bot.download_file(file_info.file_path)
with open(путь к файлу, 'wb') as new_file:
new_file.write(downloaded_file)
bot.reply_to(message, f'Ваш файл сохранен"')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question