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

13 lines
395 B
Python
Raw Normal View History

import json
2020-08-12 16:01:34 +00:00
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)
2020-06-15 11:47:29 +00:00
file = json.loads(q.text)
2020-06-15 11:57:54 +00:00
if ('missing' in file['query']['users'][0]):
2020-06-15 11:47:29 +00:00
return False
else:
2020-08-12 16:01:34 +00:00
return True