✨ Added kahoot-import
This commit is contained in:
@@ -9,7 +9,12 @@ class _Response(BaseModel):
|
||||
kahoot: _Kahoot
|
||||
|
||||
|
||||
async def get(game_id: str) -> _Response:
|
||||
async def get(game_id: str) -> _Response | None:
|
||||
async with ClientSession() as session:
|
||||
async with session.get(f"https://create.kahoot.it/rest/kahoots/{game_id}/card/?includeKahoot=true") as response:
|
||||
return _Response(**await response.json())
|
||||
if response.status == 200:
|
||||
return _Response(**await response.json())
|
||||
elif response.status == 404:
|
||||
return None
|
||||
else:
|
||||
raise Exception(f"Unexpected response status: {response.status}")
|
||||
|
||||
Reference in New Issue
Block a user