skip to Main Content

How to download a file that was sent to my bot? – Telegram API

@dp.message_handler(content_types=types.ContentType.DOCUMENT) async def scan_message(file: types.File): print("downloading document") file_path = file.file_path destination = r"C:usersaleksPycharmProjectspythonProjectfile.pdf" destination_file = bot.download_file(file_path, destination) print("success") I would like to be able to download a file (in this case it is pdf) that was sent to my bot…

VIEW QUESTION
Back To Top
Search