skip to Main Content

How not to let the call convert %20 to a space between words – Telegram API

To send a message to Telegram, I use this template: import requests headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"} urlphoto = f'http://127.0.0.1:0001/Home/Site%20de%20Trabalho%20-%20Home.html' botalert = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' chatalert = 'yyyyyyyyyyyyyyyy' urlalert = f"https://api.telegram.org/bot"…

VIEW QUESTION

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