Update whois.py

change api data format
This commit is contained in:
Jackson-Chen2007 2020-11-28 17:45:51 +08:00 committed by GitHub
parent a622055a96
commit d9e242417a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ async def whois(context):
req = get("https://tenapi.cn/whois/?url=" + message)
if req.status_code == 200:
data = json.loads(req.text)
res = 'url ' + data['data']['url'] + '\n注册商: ' + str(data['data']['注册商']) + '\n联系人: ' + str(data['data']['联系人']) + '\n联系邮箱: ' + str(data['data']['联系邮箱']) + '\n注册时间: ' + str(data['data']['注册时间']) + '\n过期时间: ' + str(data['data']['过期时间']) + '\nDNS ' + str(data['data']['DNS'])
res = '网址 ' + data['data']['url'] + '\n注册商: ' + str(data['data']['registrar']) + '\n联系人: ' + str(data['data']['registrant']) + '\n联系邮箱: ' + str(data['data']['mail']) + '\n注册时间: ' + str(data['data']['registration']) + '\n过期时间: ' + str(data['data']['expiration']) + '\nDNS ' + str(data['data']['dns'])
await context.edit(res)
else:
await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。")