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

socket.timeout on telegram bot.polling() – Telegram API

When I leave my program running for a few hours and then send a message to the bot it doesn't reply and after a while it generates the following error. Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/urllib3/connectionpool.py", line 445, in…

VIEW QUESTION
Back To Top
Search