-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfun2.py
330 lines (288 loc) · 14.4 KB
/
fun2.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
import asyncio
import random
import requests
import nekos
import os
from os import remove
from telethon.tl.types import ChannelParticipantsAdmins
from urllib import parse
from . import *
BASE_URL = "https://headp.at/pats/{}"
PAT_IMAGE = "pat.jpg"
@bot.on(d3vil_cmd(pattern="pat ?(.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="pat ?(.*)", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
username = event.pattern_match.group(1)
if not username and not event.reply_to_msg_id:
await eod(event, "`Reply to a message or provide username`")
return
resp = requests.get("http://headp.at/js/pats.json")
pats = resp.json()
pat = BASE_URL.format(parse.quote(random.choice(pats)))
await event.delete()
with open(PAT_IMAGE, "wb") as f:
f.write(requests.get(pat).content)
if username:
await bot.send_file(event.chat_id, PAT_IMAGE, caption=username)
else:
await bot.send_file(event.chat_id, PAT_IMAGE, reply_to=event.reply_to_msg_id)
remove(PAT_IMAGE)
@bot.on(d3vil_cmd(pattern="joined$", outgoing=True))
@bot.on(sudo_cmd(pattern="joined$", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
mentions = "`━━━━━┓ \n┓┓┓┓┓┃\n┓┓┓┓┓┃ ヽ○ノ ⇦ Me When You Joined \n┓┓┓┓┓┃. / \n┓┓┓┓┓┃ ノ) \n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃`"
chat = await event.get_input_chat()
async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins):
mentions += f""
reply_message = None
if event.reply_to_msg_id:
reply_message = await event.get_reply_message()
await reply_message.reply(mentions)
else:
await eor(event, mentions)
@bot.on(d3vil_cmd(pattern="pay$", outgoing=True))
@bot.on(sudo_cmd(pattern="pay$", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
mentions = "`█▀▀▀▀▀█░▀▀░░░█░░░░█▀▀▀▀▀█\n█░███░█░█▄░█▀▀░▄▄░█░███░█\n█░▀▀▀░█░▀█▀▀▄▀█▀▀░█░▀▀▀░█\n▀▀▀▀▀▀▀░▀▄▀▄▀▄█▄▀░▀▀▀▀▀▀▀\n█▀█▀▄▄▀░█▄░░░▀▀░▄█░▄▀█▀░▀\n░█▄▀░▄▀▀░░░▄▄▄█░▀▄▄▄▀▄▄▀▄\n░░▀█░▀▀▀▀▀▄█░▄░████ ██▀█▄\n▄▀█░░▄▀█▀█▀░█▄▀░▀█▄██▀░█▄\n░░▀▀▀░▀░█▄▀▀▄▄░▄█▀▀▀█░█▀▀\n█▀▀▀▀▀█░░██▀█░░▄█░▀░█▄░██\n█░███░█░▄▀█▀██▄▄▀▀█▀█▄░▄▄\n█░▀▀▀░█░█░░▀▀▀░█░▀▀▀▀▄█▀░\n▀▀▀▀▀▀▀░▀▀░░▀░▀░░░▀▀░▀▀▀▀`"
chat = await event.get_input_chat()
async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins):
mentions += f""
reply_message = None
if event.reply_to_msg_id:
reply_message = await event.get_reply_message()
await reply_message.reply(mentions)
else:
await eor(event, mentions)
@bot.on(d3vil_cmd(pattern="climb$", outgoing=True))
@bot.on(sudo_cmd(pattern="climb$", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
mentions = "`😏/\n/▌ \n/ \\n████\n╬╬\n╬╬\n╬╬\n╬╬\n╬╬\n╬╬\n╬╬\😦\n╬╬/▌\n╬╬/\`"
chat = await event.get_input_chat()
async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins):
mentions += f""
reply_message = None
if event.reply_to_msg_id:
reply_message = await event.get_reply_message()
await reply_message.reply(mentions)
else:
await eor(event, mentions)
@bot.on(d3vil_cmd(pattern="aag$", outgoing=True))
@bot.on(sudo_cmd(pattern="aag$", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
mentions = "`😲💨 🔥\n/|\ 🔥🔥\n/ \ 🔥🔥🔥`"
chat = await event.get_input_chat()
async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins):
mentions += f""
reply_message = None
if event.reply_to_msg_id:
reply_message = await event.get_reply_message()
await reply_message.reply(mentions)
else:
await eor(event, mentions)
@bot.on(d3vil_cmd(pattern="push$", outgoing=True))
@bot.on(sudo_cmd(pattern="push$", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
mentions = "`. 😎\n |\👐\n / \\\n━━━━━┓ \\ \n┓┓┓┓┓┃\n┓┓┓┓┓┃ ヽ😩ノ\n┓┓┓┓┓┃ / \n┓┓┓┓┓┃ ノ) \n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃\n┓┓┓┓┓┃`"
chat = await event.get_input_chat()
async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins):
mentions += f""
reply_message = None
if event.reply_to_msg_id:
reply_message = await event.get_reply_message()
await reply_message.reply(mentions)
else:
await eor(event, mentions)
@bot.on(d3vil_cmd(pattern="work$", outgoing=True))
@bot.on(sudo_cmd(pattern="work$", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
mentions = "`📔📚 📚\n📓📚📖 😫 📚📚📓\n📕📚📚 📝 📗💻📘\n📖📖📖📖📖📖📖📖📖`"
chat = await event.get_input_chat()
async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins):
mentions += f""
reply_message = None
if event.reply_to_msg_id:
reply_message = await event.get_reply_message()
await reply_message.reply(mentions)
else:
await eor(event, mentions)
@bot.on(d3vil_cmd(pattern="suckit$", outgoing=True))
@bot.on(sudo_cmd(pattern="suckit$", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
mentions = "`......................................... \n \n𝕔𝕠𝕞𝕖 𝕥𝕠 𝕞𝕖, 𝕞𝕪 𝕔𝕙𝕚𝕝𝕕𝕣𝕖𝕟 \n`` \n. . /. ))) . . . . . . . . . (((ヽ \n/. .ノ ̄. . . ___. . . ̄ Y .\ \n| . (.\, . . . ( ͡° ͜ʖ ͡°). . . ./.) . ) \nヽ.ヽ..ᯢ._.|﹀|._._ノ₄₂₀ // \n. . .\|. 𓀐𓂸Y. . ࿕. . . / \n. . . .|. \. . ᯪ. . .|. . ᯪ. . ノ \n. . . . . \ .トー仝ーイ \n. . . . . . . |. ミ土彡 / \n. . . . . . . )\. . .° . ./( \n. . . . . . /. . .\͎̦ ̷̫ ̴́ ̴̢/̴͖. . \ \n. . . . . /. ⁶⁹ . /̴͝Ѽ̔̕☰̴̈́☰☰☰☰D,̰̱ \n. . . . /. / . . / . . .\. \. . \ \n. . . .((. . . .(. . . . .). . . .)) \n. . . .| . . . .). . . . .(|. . . / \n. . . . |. . . /. . . . /. . . ./ \n. . . . |. . ..| . . . ./. . ./. . ... . . 𓁉𓀏𓀃𓁏`"
chat = await event.get_input_chat()
async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins):
mentions += f""
reply_message = None
if event.reply_to_msg_id:
reply_message = await event.get_reply_message()
await reply_message.reply(mentions)
else:
await eor(event, mentions)
@bot.on(d3vil_cmd(pattern="ohh$", outgoing=True))
@bot.on(sudo_cmd(pattern="ohh$", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
mentions = "`´´´´´████████´´\n´´`´███▒▒▒▒███´´´´´\n´´´███▒●▒▒●▒██´´´\n´´´███▒▒👄▒▒██´´\n´´█████▒▒████´´´´´\n´█████▒▒▒▒███´´\n█████▒▒▒▒▒▒███´´´´\n´´▓▓▓▓▓▓▓▓▓▓▓▓▓▒´´\n´´▒▒▒▒▓▓▓▓▓▓▓▓▓▒´´´´´\n´.▒▒▒´´▓▓▓▓▓▓▓▓▒´´´´´\n´.▒▒´´´´▓▓▓▓▓▓▓▒\n..▒▒.´´´´▓▓▓▓▓▓▓▒\n´▒▒▒▒▒▒▒▒▒▒▒▒\n´´´´´´´´´███████´´´´\n´´´´´´´´████████´´´´´´\n´´´´´´´█████████´´´´´\n´´´´´´██████████´´´\n´´´´´´██████████´´\n´´´´´´´█████████´\n´´´´´´´█████████´\n´´´´´´´´████████´´´\n´´´´´´´´´´´▒▒▒▒▒´´´\n´´´´´´´´´´▒▒▒▒▒´´´\n´´´´´´´´´´▒▒▒▒▒´´´\n´´´´´´´´´´▒▒´▒▒´´´\n´´´´´´´´´▒▒´´▒▒´´´\n´´´´´´´´´´▒▒´´´▒▒´´´\n´´´´´´´´´▒▒´´´▒▒´´´\n´´´´´´´´▒▒´´´´´▒▒´´´\n´´´´´´´´▒▒´´´´´´▒▒´´´\n´´´´´´´´███´´´´███´´´\n´´´´´´´´████´´███´´´\n´´´´´´´´█´´███´´████´´´`"
chat = await event.get_input_chat()
async for x in borg.iter_participants(chat, filter=ChannelParticipantsAdmins):
mentions += f""
reply_message = None
if event.reply_to_msg_id:
reply_message = await event.get_reply_message()
await reply_message.reply(mentions)
else:
await eor(event, mentions)
@bot.on(d3vil_cmd(pattern="lovestory$", outgoing=True))
@bot.on(sudo_cmd(pattern="lovestory$", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 3
animation_ttl = range(0, 103)
await eor(event, "Starting asf")
animation_chars = [
"1 ❤️ love story",
" 😐 😕 \n/👕\ <👗\ \n 👖 /|",
" 😉 😳 \n/👕\ /👗\ \n 👖 /|",
" 😚 😒 \n/👕\ <👗> \n 👖 /|",
" 😍 ☺️ \n/👕\ /👗\ \n 👖 /|",
" 😍 😍 \n/👕\ /👗\ \n 👖 /|",
" 😘 😊 \n /👕\/👗\ \n 👖 /|",
" 😳 😁 \n /|\ /👙\ \n / / |",
"😈 /😰\ \n<|\ 👙 \n /🍆 / |",
"😅 \n/(),✊😮 \n /\ _/\\/|",
"😎 \n/\\_,__😫 \n // // \\",
"😖 \n/\\_,💦_😋 \n // // \\",
" 😭 ☺️ \n /|\ /(👶)\ \n /!\ / \ ",
"The End 😂...",
]
for i in animation_ttl:
await asyncio.sleep(animation_interval)
await event.edit(animation_chars[i % 103])
@bot.on(d3vil_cmd(pattern="bf$", outgoing=True))
@bot.on(sudo_cmd(pattern="bf$", allow_sudo=True))
async def pressf(f):
if f.fwd_from:
return
"""Pays respects"""
args = f.text.split()
arg = (f.text.split(" ", 1))[1] if len(args) > 1 else None
if len(args) == 1:
r = random.randint(0, 3)
LOGS.info(r)
if r == 0:
await eor(f, "┏━━━┓\n┃┏━━┛\n┃┗━━┓\n┃┏━━┛\n┃┃\n┗┛")
elif r == 1:
await eor(f, "╭━━━╮\n┃╭━━╯\n┃╰━━╮\n┃╭━━╯\n┃┃\n╰╯")
else:
arg = "F"
if arg is not None:
out = ""
F_LENGTHS = [5, 1, 1, 4, 1, 1, 1]
for line in F_LENGTHS:
c = max(round(line / len(arg)), 1)
out += (arg * c) + "\n"
await eor(f"`" + out + "`")
@bot.on(d3vil_cmd(pattern="session$", outgoing=True))
@bot.on(sudo_cmd(pattern="session$", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
mentions = "**telethon.errors.rpcerrorlist.AuthKeyDuplicatedError: The authorization key (session file) was used under two different IP addresses simultaneously, and can no longer be used. Use the same session exclusively, or use different sessions (caused by GetMessagesRequest)**"
await eor(event, mentions)
@bot.on(d3vil_cmd(pattern="ftext ?(.*)"))
@bot.on(sudo_cmd(pattern="ftext ?(.*)", allow_sudo=True))
async def payf(event):
if event.fwd_from:
return
input_str = event.pattern_match.group(1)
if input_str:
paytext = input_str
pay = "{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}".format(
paytext * 8,
paytext * 8,
paytext * 2,
paytext * 2,
paytext * 2,
paytext * 6,
paytext * 6,
paytext * 2,
paytext * 2,
paytext * 2,
paytext * 2,
paytext * 2,
)
else:
pay = "╭━━━╮\n┃╭━━╯\n┃╰━━╮\n┃╭━━╯\n┃┃\n╰╯\n"
await event.edit(pay)
@bot.on(d3vil_cmd(pattern="cat$"))
@bot.on(sudo_cmd(pattern="cat$", allow_sudo=True))
async def hmm(d3vil):
if d3vil.fwd_from:
return
reactcat = nekos.textcat()
await eor(d3vil, reactcat)
@bot.on(d3vil_cmd(pattern="why$"))
@bot.on(sudo_cmd(pattern="why$", allow_sudo=True))
async def hmm(d3vil):
if d3vil.fwd_from:
return
whyd3vil = nekos.why()
await eor(d3vil, whyd3vil)
@bot.on(d3vil_cmd(pattern="fact$"))
@bot.on(sudo_cmd(pattern="fact$", allow_sudo=True))
async def hmm(d3vil):
if d3vil.fwd_from:
return
factd3vil = nekos.fact()
await eor(d3vil, factd3vil)
CmdHelp("fun2").add_command(
"join", None, "Use and see"
).add_command(
"bf", None, "Use and see"
).add_command(
"push", None, "Use and see"
).add_command(
"lovestory", None, "Use and see"
).add_command(
"session", None, "Use and see"
).add_command(
"ohh", None, "Use and see"
).add_command(
"suckit", None, "Use and see"
).add_command(
"work", None, "Use and see"
).add_command(
"aag", None, "Use and see"
).add_command(
"climb", None, "Use and see"
).add_command(
"pay", None, "Use and see"
).add_command(
"pat", "<reply> or <@username>", "Pats the user."
).add_command(
"cat", None, "Sends you some random cat facial text art"
).add_command(
"why", None, "Asks some random funny questions"
).add_command(
"fact", None, "Sends you some random facts"
).add_command(
"ftext", "<text>", "Writes your text in "F" format"
).add()