animelist.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Jumper-Cogs 作者: Redjumpman 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号