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

19 lines
543 B
Python
Raw Normal View History

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:
2022-08-01 15:33:35 +00:00
get_ = await get_url(botarcapi_url + f"user/info?user={user}", status_code=200, 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