-
Notifications
You must be signed in to change notification settings - Fork 5
/
bots.py
176 lines (157 loc) · 6.29 KB
/
bots.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
import asyncio
import random, re
import datetime
from telethon.tl.functions.account import UpdateNotifySettingsRequest
from telegraph import Telegraph
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from ULTRA import CMD_HELP
from ULTRA.utils import admin_cmd
from var import Var
telegraph = Telegraph()
mee = telegraph.create_account(short_name="yohohehe")
@borg.on(admin_cmd(pattern="recognize ?(.*)"))
async def _(event):
if event.fwd_from:
return
if not event.reply_to_msg_id:
await event.edit("Reply to any user's media message.")
return
reply_message = await event.get_reply_message()
if not reply_message.media:
await event.edit("reply to media file")
return
chat = "@Rekognition_Bot"
sender = reply_message.sender
if reply_message.sender.bot:
await event.edit("Reply to actual users message.")
return
cat = await event.edit("recognizeing this media")
async with event.client.conversation(chat) as conv:
try:
response = conv.wait_event(events.NewMessage(incoming=True,from_users=461083923))
await event.client.forward_messages(chat, reply_message)
response = await response
except YouBlockedUserError:
await event.edit("unblock @Rekognition_Bot and try again")
await cat.delete()
return
if response.text.startswith("See next message."):
response = conv.wait_event(events.NewMessage(incoming=True,from_users=461083923))
response = await response
cat = response.message.message
await event.edit(cat)
else:
await event.edit("sorry, I couldnt find it")
@borg.on(admin_cmd(pattern="wspr ?(.*)"))
async def wspr(event):
if event.fwd_from:
return
wwwspr = event.pattern_match.group(1)
botusername = "@whisperBot"
if event.reply_to_msg_id:
reply_to_id = await event.get_reply_message()
tap = await bot.inline_query(botusername, wwwspr)
await tap[0].click(event.chat_id)
await event.delete()
@borg.on(admin_cmd(pattern="purl ?(.*)"))
async def _(event):
if event.fwd_from:
return
if not event.reply_to_msg_id:
await event.edit("**Reply to any document.**")
return
reply_message = await event.get_reply_message()
chat = "@FiletolinkTGbot"
reply_message.sender
await event.edit("**Making public url...**")
async with event.client.conversation(chat) as conv:
try:
response = conv.wait_event(
events.NewMessage(incoming=True, from_users=1011636686)
)
await event.client.forward_messages(chat, reply_message)
response = await response
except YouBlockedUserError:
await event.edit("```Please unblock me (@FiletolinkTGbot) u Nigga```")
return
await event.delete()
await event.client.send_message(
event.chat_id, response.message, reply_to=reply_message
)
@borg.on(admin_cmd(pattern="limits ?(.*)"))
async def _(event):
bot = "@SpamBot"
if event.fwd_from:
return
sysarg = event.pattern_match.group(1)
if sysarg == "":
async with borg.conversation(bot) as conv:
try:
await conv.send_message("/start")
await conv.get_response()
await conv.send_message("/start")
danish = await conv.get_response()
final = ("HeHe", "")
await borg.send_message(event.chat_id, danish.text)
await event.delete()
except YouBlockedUserError:
await event.edit("**Error:** `unblock` @spambot `and retry!")
@borg.on(admin_cmd(pattern="sgm ?(.*)", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
if not event.reply_to_msg_id:
await event.edit("**Reply to an user message.**")
return
reply_message = await event.get_reply_message()
if not reply_message.text:
await event.edit("**Reply to a message.**")
return
chat = "@sangmatainfo_bot"
sender = reply_message.sender
await event.edit("**Getting user's name history..**")
async with event.client.conversation(chat) as conv:
try:
response = conv.wait_event(events.NewMessage(incoming=True,from_users=461843263))
await event.client.forward_messages(chat, reply_message)
response = await response
except YouBlockedUserError:
await event.reply("Please unblock me @SangMataInfo_bot")
return
await event.delete()
await event.client.send_message(event.chat_id, response.message, reply_to=reply_message)
@borg.on(admin_cmd(pattern="reader ?(.*)", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
if not event.reply_to_msg_id:
await event.edit("**Reply to a URL.**")
return
reply_message = await event.get_reply_message()
if not reply_message.text:
await event.edit("**Reply to a url message.**")
return
chat = "@chotamreaderbot"
sender = reply_message.sender
await event.edit("**Making instant view...**")
async with event.client.conversation(chat) as conv:
try:
response = conv.wait_event(events.NewMessage(incoming=True,from_users=272572121))
await event.client.forward_messages(chat, reply_message)
response = await response
except YouBlockedUserError:
await event.reply("Please unblock me @chotamreaderbot")
return
await event.delete()
await event.client.send_message(event.chat_id, response.message, reply_to=reply_message)
CMD_HELP.update(
{
"bots": ".purl (reply to file)\nUse - Get a direct download link of that file/doc/pic/vid\
\n\n.reader (reply to url)\nUse - Open that url in telegraph .\
\n\n.sgm (reply to any user or tag)\nUse - send details of that user.\
\n\n.recognize (reply to any media)\nUse - send details about it.\
\n\n.wspr (message) (target username/id)\nUse - Send a whisper message to that person.\
\n\n.limits\nUse - Check if you are limited by telegram."
}
)