📦 whois 优化逻辑 , 修改措辞 (#81)

* 📦 whois 优化逻辑 , 修改措辞

* Update list.json
This commit is contained in:
Xtao_dada 2020-11-28 19:28:00 +08:00 committed by GitHub
parent f7f6e76292
commit e74f374d1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -192,7 +192,7 @@
},
{
"name": "whois",
"version": "1.1",
"version": "1.11",
"section": "daily",
"maintainer": "KorenKrita",
"size": "1.1 kb",

View File

@ -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('<br/>', '\n')
await context.edit(res)
else:
await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。")