mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-25 12:17:50 +00:00
💩 tel 手机号码归属地 错误修复
This commit is contained in:
parent
cd4a49c21d
commit
fca2ec442c
@ -182,9 +182,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "tel",
|
"name": "tel",
|
||||||
"version": "1.0",
|
"version": "1.1",
|
||||||
"section": "daily",
|
"section": "daily",
|
||||||
"maintainer": "KorenKrita",
|
"maintainer": "KorenKrita、xtaodada",
|
||||||
"size": "1 kb",
|
"size": "1 kb",
|
||||||
"supported": true,
|
"supported": true,
|
||||||
"des-short": "查询手机号码归属地等信息",
|
"des-short": "查询手机号码归属地等信息",
|
||||||
|
8
tel.py
8
tel.py
@ -7,7 +7,7 @@ from pagermaid.utils import obtain_message
|
|||||||
|
|
||||||
@listener(outgoing=True, command="tel",
|
@listener(outgoing=True, command="tel",
|
||||||
description="手机号码归属地等信息查询。")
|
description="手机号码归属地等信息查询。")
|
||||||
async def whois(context):
|
async def tel(context):
|
||||||
await context.edit("获取中 . . .")
|
await context.edit("获取中 . . .")
|
||||||
try:
|
try:
|
||||||
message = await obtain_message(context)
|
message = await obtain_message(context)
|
||||||
@ -17,7 +17,11 @@ async def whois(context):
|
|||||||
req = get("https://tenapi.cn/tel?tel=" + message)
|
req = get("https://tenapi.cn/tel?tel=" + message)
|
||||||
if req.status_code == 200:
|
if req.status_code == 200:
|
||||||
data = json.loads(req.text)
|
data = json.loads(req.text)
|
||||||
res = '电话号码:' + str(data['tel']) + '\n' + str(data['local']) + '\n' + str(data['duan']) + '\n' + str(data['type']) + '\n' + str(data['yys']) + '\n' + str(data['bz'])
|
if not 'msg' in data:
|
||||||
|
res = '电话号码:' + str(data['tel']) + '\n' + str(data['local']) + '\n' + str(data['duan']) + '\n' + str(
|
||||||
|
data['type']) + '\n' + str(data['yys']) + '\n' + str(data['bz'])
|
||||||
|
else:
|
||||||
|
res = data['msg']
|
||||||
await context.edit(res)
|
await context.edit(res)
|
||||||
else:
|
else:
|
||||||
await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。")
|
await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。")
|
||||||
|
Loading…
Reference in New Issue
Block a user