Ошибка у бота при отправке файла
Ошибка
2020-11-30 03:09:46,260 (__init__.py:455 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body:
[b'{"ok":false,"error_code":400,"description":"Bad Request: file must be non-empty"}']"
вот из-за этой функции выдает ошибку :(
// Скачивание документов
@bot.message_handler(content_types=["document"])
def handle_text_doc(message):
file_info = bot.get_file(message.document.file_id)
downloaded_file = bot.download_file(file_info.file_path)
src = 'C:\Python\photo' + message.document.file_id
with open(src, 'wb') as new_file:
new_file.write(downloaded_file)