mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-22 05:09:15 +00:00
🚩 手机号码归属地等信息查询插件,上架 (#8)
This commit is contained in:
parent
91a2bfa2a8
commit
cd4a49c21d
@ -69,4 +69,4 @@
|
||||
- `hyperlink` : 生成隐藏链接。
|
||||
- `whois` : 查询域名信息
|
||||
- `resou` : 知乎,抖音,微博实时热搜
|
||||
|
||||
- `tel` : 查询手机号码归属地等信息
|
||||
|
10
list.json
10
list.json
@ -180,6 +180,16 @@
|
||||
"des-short": "随机带评价买家秀,随机涩气买家秀",
|
||||
"des": "命令:mjx,sqmjx。"
|
||||
},
|
||||
{
|
||||
"name": "tel",
|
||||
"version": "1.0",
|
||||
"section": "daily",
|
||||
"maintainer": "KorenKrita",
|
||||
"size": "1 kb",
|
||||
"supported": true,
|
||||
"des-short": "查询手机号码归属地等信息",
|
||||
"des": "查询电话号码归属地,号码段,卡类型,运营商及通信标准。命令:tel。"
|
||||
},
|
||||
{
|
||||
"name": "whois",
|
||||
"version": "1.0",
|
||||
|
23
tel.py
Normal file
23
tel.py
Normal 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 服务器 。")
|
Loading…
Reference in New Issue
Block a user