su-automod/functions/get_user_details.py

20 lines
533 B
Python
Executable File

import aiohttp
async def get_user_details(user_id):
url = f"https://sketchersunited.org/users/{user_id}"
headers = {
"Accept": "application/json",
"User-Agent": "automod by username"
}
async with aiohttp.ClientSession() as session:
async with session.get(url, headers=headers) as response:
if response.status != 200:
print(f"Failed to fetch data: {response.status}")
return None
data = await response.json()
return data