no-name-here commited on
Commit
d08f4e6
·
verified ·
1 Parent(s): abf6e09

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -1
main.py CHANGED
@@ -7,12 +7,16 @@
7
  # exclusively for downloading / forwarding media via MTProto.
8
 
9
  import os
 
10
  import shutil
11
  import psutil
12
  import asyncio
13
  from time import time
14
  from contextlib import asynccontextmanager
15
 
 
 
 
16
  from fastapi import FastAPI, Request
17
  from fastapi.responses import JSONResponse
18
 
@@ -526,4 +530,4 @@ async def telegram_webhook(request: Request):
526
  track_task(handle_download(chat_id, msg_id, text))
527
  return JSONResponse({"status": "ok"})
528
 
529
- return JSONResponse({"status": "ok"})
 
7
  # exclusively for downloading / forwarding media via MTProto.
8
 
9
  import os
10
+ import sys
11
  import shutil
12
  import psutil
13
  import asyncio
14
  from time import time
15
  from contextlib import asynccontextmanager
16
 
17
+ # Ensure the project root is on sys.path so `helpers.*` imports always resolve
18
+ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
19
+
20
  from fastapi import FastAPI, Request
21
  from fastapi.responses import JSONResponse
22
 
 
530
  track_task(handle_download(chat_id, msg_id, text))
531
  return JSONResponse({"status": "ok"})
532
 
533
+ return JSONResponse({"status": "ok"})