diff --git a/list.json b/list.json index 5f28fad..ca51184 100644 --- a/list.json +++ b/list.json @@ -192,7 +192,7 @@ }, { "name": "whois", - "version": "1.1", + "version": "1.11", "section": "daily", "maintainer": "KorenKrita", "size": "1.1 kb", diff --git a/whois.py b/whois.py index 2a75b35..f55786c 100644 --- a/whois.py +++ b/whois.py @@ -16,8 +16,8 @@ async def whois(context): return req = get("https://tenapi.cn/whois/?url=" + message) if req.status_code == 200: - data = json.loads(req.text) - 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']) + data = json.loads(req.text)['data'] + res = '域名: `' + data['url'] + '`\n注册商: `' + str(data['registrar']) + '`\n联系人: `' + str(data['registrant']) + '`\n联系邮箱: `' + str(data['mail']) + '`\n注册时间: `' + str(data['registration']) + '`\n过期时间: `' + str(data['expiration']) + '`\nDNS: ' + str(data['dns']).replace('
', '\n') await context.edit(res) else: await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。")