sessionservice/app/token_client.py
2023-03-01 19:01:35 +00:00

11 lines
353 B
Python

__all__ = ("token_client",)
import aiohttp
async def token_client(access_token: str) -> dict | None:
headers = {"Authorization": f"Bearer {access_token}"}
async with aiohttp.ClientSession() as session:
async with session.get("https://discord.com/api/oauth2/@me", headers=headers) as response:
return await response.json()