Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/modules/arcaea/utils.py
2022-01-20 20:13:03 +08:00

18 lines
526 B
Python

import traceback
from config import Config
from core.utils import get_url
botarcapi_url = Config("botarcapi_url")
headers = {"User-Agent": Config('botarcapi_agent')}
async def get_userinfo(user):
try:
get_ = await get_url(botarcapi_url + f"user/info?user={user}", headers=headers, fmt='json')
username = get_['content']['account_info']['name']
code = get_['content']['account_info']['code']
return username, code
except Exception:
traceback.print_exc()
return False