nospaces-recheck-patch
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import aiohttp
|
||||
import aiofiles
|
||||
import os
|
||||
import json
|
||||
from urllib.parse import urlencode
|
||||
from bot.config import BOT_TOKEN
|
||||
@@ -36,11 +35,10 @@ async def telegram_api(endpoint: str, json_data=None, **kwargs):
|
||||
|
||||
async def download_file(file_id):
|
||||
"""Asynchronously download a file from Telegram and yield the temporary file path."""
|
||||
download_url = f"{api_base}/{file_path}"
|
||||
|
||||
# Get the file path of the file using the telegram_api method
|
||||
file = await telegram_api("getFile", file_id=file_id)
|
||||
file_path = file["result"]["file_path"]
|
||||
download_url = f"{api_base}/{file_path}"
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(download_url) as response:
|
||||
|
Reference in New Issue
Block a user