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/checkuser.py
2020-08-18 21:12:38 +08:00

12 lines
395 B
Python

import json
import requests
def checkuser(path, username):
url = 'https://' + path + '.gamepedia.com/api.php?action=query&list=users&ususers=' + username + '&usprop=groups%7Cblockinfo%7Cregistration%7Ceditcount%7Cgender&format=json'
q = requests.get(url)
file = json.loads(q.text)
if ('missing' in file['query']['users'][0]):
return False
else:
return True