from App import bot from fastapi import UploadFile from App.Transcription.Model import Transcriptions async def perform_background_task(file: UploadFile, task_id: str): data = await bot.send_file( -1001925049183, file_size=file.size, caption=file.filename, file=f"./{file.filename}", ) # get entry and update entry: Transcriptions = await Transcriptions.objects.filter(task_id=task_id).first() await entry.update(tl_file_id=str(data.id))