-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCheckerTG.py
85 lines (76 loc) · 2.96 KB
/
CheckerTG.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# .------.------.------.------.------.------.------.------.------.------.
# |D.--. |4.--. |N.--. |1.--. |3.--. |L.--. |3.--. |K.--. |0.--. |0.--. |
# | :/\: | :/\: | :(): | :/\: | :(): | :/\: | :(): | :/\: | :/\: | :/\: |
# | (__) | :\/: | ()() | (__) | ()() | (__) | ()() | :\/: | :\/: | :\/: |
# | '--'D| '--'4| '--'N| '--'1| '--'3| '--'L| '--'3| '--'K| '--'0| '--'0|
# `------`------`------`------`------`------`------`------`------`------'
#
# Copyright 2023 t.me/D4n13l3k00
# Licensed under the Creative Commons CC BY-NC-ND 4.0
#
# Full license text can be found at:
# https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode
#
# Human-friendly one:
# https://creativecommons.org/licenses/by-nc-nd/4.0
# meta developer: @D4n13l3k00
import aiohttp
from .. import loader, utils # type: ignore
@loader.tds
class CheckerTGMod(loader.Module):
"""CheckerTG"""
strings = {
"name": "CheckerTG",
"check": "<b>[CheckerAPI]</b> Делаем запрос к API...",
"response": "<b>[CheckerAPI]</b> Ответ API: <code>{}</code>\nВремя выполнения: <code>{}</code>",
}
@loader.owner
async def checkcmd(self, m):
"""Проверить id на слитый номер
Жуёт либо <reply> либо <uid>
"""
reply = await m.get_reply_message()
if utils.get_args_raw(m):
user = utils.get_args_raw(m)
elif reply:
try:
user = str(reply.sender.id)
except Exception:
return await m.edit("<b>Err</b>")
else:
return await m.edit("[CheckerAPI] А кого чекать?")
await m.edit(self.strings["check"])
async with aiohttp.ClientSession() as s, s.get(
f"https://api.d4n13l3k00.ru/tg/leaked/check?uid={user}"
) as r:
r = await r.json()
await m.edit(
self.strings["response"].format(
r["data"], str(round(r["time"], 3)) + "ms"
)
)
@loader.owner
async def rcheckcmd(self, m):
"""Обратный поиск
Жуёт <phone number>
"""
reply = await m.get_reply_message()
if utils.get_args_raw(m):
phone = utils.get_args_raw(m)
elif reply:
try:
phone = reply.raw_text
except Exception:
return await m.edit("<b>Err</b>")
else:
return await m.edit("[CheckerAPI] А кого чекать?")
await m.edit(self.strings["check"])
async with aiohttp.ClientSession() as s, s.get(
f"https://api.d4n13l3k00.ru/tg/leaked/check?r=1?uid={phone}"
) as r:
r = await r.json()
await m.edit(
self.strings["response"].format(
r["data"], str(round(r["time"], 3)) + "ms"
)
)