Update main.py
Browse files
main.py
CHANGED
|
@@ -14,11 +14,16 @@ from fastapi.responses import FileResponse
|
|
| 14 |
from app.invite_logic import DiscordInviteLogic
|
| 15 |
invite_app = DiscordInviteLogic()
|
| 16 |
|
|
|
|
|
|
|
|
|
|
| 17 |
@asynccontextmanager
|
| 18 |
async def lifespan(app: FastAPI):
|
| 19 |
await invite_app.start()
|
|
|
|
| 20 |
yield
|
| 21 |
await invite_app.stop()
|
|
|
|
| 22 |
|
| 23 |
app = FastAPI(lifespan=lifespan)
|
| 24 |
|
|
@@ -30,6 +35,13 @@ async def get_new_invite():
|
|
| 30 |
if "error" in res:
|
| 31 |
raise HTTPException(status_code=500, detail=res["error"])
|
| 32 |
return res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
@app.get("/")
|
| 35 |
def home():
|
|
|
|
| 14 |
from app.invite_logic import DiscordInviteLogic
|
| 15 |
invite_app = DiscordInviteLogic()
|
| 16 |
|
| 17 |
+
from app.cl_lq import ClLqApp
|
| 18 |
+
lq_app = ClLqApp()
|
| 19 |
+
|
| 20 |
@asynccontextmanager
|
| 21 |
async def lifespan(app: FastAPI):
|
| 22 |
await invite_app.start()
|
| 23 |
+
await lq_app.start()
|
| 24 |
yield
|
| 25 |
await invite_app.stop()
|
| 26 |
+
await lq_app.stop()
|
| 27 |
|
| 28 |
app = FastAPI(lifespan=lifespan)
|
| 29 |
|
|
|
|
| 35 |
if "error" in res:
|
| 36 |
raise HTTPException(status_code=500, detail=res["error"])
|
| 37 |
return res
|
| 38 |
+
|
| 39 |
+
@app.get("/api/v1/get/lqAov")
|
| 40 |
+
async def get_free_account():
|
| 41 |
+
res = await lq_app.fetch_acc()
|
| 42 |
+
if not res["ok"]:
|
| 43 |
+
raise HTTPException(status_code=500, detail=res["error"])
|
| 44 |
+
return res
|
| 45 |
|
| 46 |
@app.get("/")
|
| 47 |
def home():
|