I need to get a file from user, download it, pass into a function to process it, and then send it back to the user.
I've read the docs multiple times, but I still don't understand how to get a file_id and work with it.
That's an echo code I've tried. It shows a TypeError: 'NoneType' object is not subscriptable on the fileID line.
update.message.reply_text('give a file')
chat_id = update.message.chat_id
fileID = update.message['document']['file_id']
context.bot.sendDocument(chat_id = chat_id,
caption = 'This is the file that you have sent to bot',
document = fileID)