Files
classquiz-ai/classquiz/kahoot_importer/get.py
T
2022-03-08 21:20:53 +01:00

16 lines
447 B
Python

from aiohttp import ClientSession
from pydantic import BaseModel
from classquiz.kahoot_importer import _Card, _Kahoot
class _Response(BaseModel):
card: _Card
kahoot: _Kahoot
async def get(game_id: str) -> _Response:
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())