more fix
This commit is contained in:
2
app.py
2
app.py
@ -107,7 +107,7 @@ async def flood(pin: int = Form(0), naming: str = Form(""), name: str = Form("")
|
|||||||
async with session.get(f"https://play.kahoot.it/reserve/session/{pin}/?{int(time.time() * 1000)}") as response:
|
async with session.get(f"https://play.kahoot.it/reserve/session/{pin}/?{int(time.time() * 1000)}") as response:
|
||||||
if "x-kahoot-session-token" not in response.headers:
|
if "x-kahoot-session-token" not in response.headers:
|
||||||
return JSONResponse({"message": "Invalid PIN specified.", "type": "error"}, 400)
|
return JSONResponse({"message": "Invalid PIN specified.", "type": "error"}, 400)
|
||||||
if len(name) < 2 or len(name) > 15:
|
if len(name) < 2 or len(name) > 15 and naming != "random":
|
||||||
return JSONResponse({"message": "Invalid name specified.", "type": "error"}, 400)
|
return JSONResponse({"message": "Invalid name specified.", "type": "error"}, 400)
|
||||||
if amount < 1 or amount > 2000:
|
if amount < 1 or amount > 2000:
|
||||||
return JSONResponse({"message": "Invalid amount specified.", "type": "error"}, 400)
|
return JSONResponse({"message": "Invalid amount specified.", "type": "error"}, 400)
|
||||||
|
@ -52,8 +52,8 @@ window.onload = () => {
|
|||||||
body: formData
|
body: formData
|
||||||
})
|
})
|
||||||
response = await request.json();
|
response = await request.json();
|
||||||
text.innerText = response.message;
|
text.innerText = response["message"];
|
||||||
if (response.type == "error")
|
if (response["type"] == "error")
|
||||||
{
|
{
|
||||||
text.style.color = "red";
|
text.style.color = "red";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user