def credential_verfication(self, username, password):
auth = aiohttp.BasicAuth(login=username, password=password)
url = "https://myanimelist.net/api/account/verify_credentials.xml"
with aiohttp.ClientSession(auth=auth) as session:
async with session.get(url) as response:
status = response.status
if status == 200:
return True
if status == 401:
await self.bot.say("Username and Password is incorrect.")
return False
if status == 403:
await self.bot.say("Too many failed login attempts. Try putting in the"
"correct credentials after some time has passed.")
return False
评论列表
文章目录