🚩 手机号码归属地等信息查询插件,上架 (#8)

This commit is contained in:
KorenKrita 2020-08-13 02:36:51 +08:00 committed by GitHub
parent 91a2bfa2a8
commit cd4a49c21d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 1 deletions

View File

@ -69,4 +69,4 @@
- `hyperlink` : 生成隐藏链接。 - `hyperlink` : 生成隐藏链接。
- `whois` : 查询域名信息 - `whois` : 查询域名信息
- `resou` : 知乎,抖音,微博实时热搜 - `resou` : 知乎,抖音,微博实时热搜
- `tel` : 查询手机号码归属地等信息

View File

@ -180,6 +180,16 @@
"des-short": "随机带评价买家秀,随机涩气买家秀", "des-short": "随机带评价买家秀,随机涩气买家秀",
"des": "命令mjxsqmjx。" "des": "命令mjxsqmjx。"
}, },
{
"name": "tel",
"version": "1.0",
"section": "daily",
"maintainer": "KorenKrita",
"size": "1 kb",
"supported": true,
"des-short": "查询手机号码归属地等信息",
"des": "查询电话号码归属地号码段卡类型运营商及通信标准。命令tel。"
},
{ {
"name": "whois", "name": "whois",
"version": "1.0", "version": "1.0",

23
tel.py Normal file
View File

@ -0,0 +1,23 @@
import json
import os,sys,codecs
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
from requests import get
from pagermaid.listener import listener
from pagermaid.utils import obtain_message
@listener(outgoing=True, command="tel",
description="手机号码归属地等信息查询。")
async def whois(context):
await context.edit("获取中 . . .")
try:
message = await obtain_message(context)
except ValueError:
await context.edit("出错了呜呜呜 ~ 无效的参数。")
return
req = get("https://tenapi.cn/tel?tel=" + message)
if req.status_code == 200:
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'])
await context.edit(res)
else:
await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。")