From e74f374d1cc109627527b8fbeda98b1fb9f1e0f4 Mon Sep 17 00:00:00 2001 From: Xtao_dada Date: Sat, 28 Nov 2020 19:28:00 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20whois=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=80=BB=E8=BE=91=20,=20=E4=BF=AE=E6=94=B9=E6=8E=AA=E8=BE=9E?= =?UTF-8?q?=20(#81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📦 whois 优化逻辑 , 修改措辞 * Update list.json --- list.json | 2 +- whois.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 服务器 。")