-
Notifications
You must be signed in to change notification settings - Fork 83
/
memes.py
435 lines (408 loc) Β· 13.2 KB
/
memes.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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# Copyright (C) 2019 The Raphielscape Company LLC.
# Licensed under the Raphielscape Public License, Version 1.b (the "License");
# you may not use this file except in compliance with the License.
# catUserbot module for having some fun with people.
import asyncio
import random
import re
import requests
from cowpy import cow
from telethon.tl.types import ChannelParticipantsAdmins
from userbot import catub
from userbot.core.managers import edit_delete, edit_or_reply
from userbot.helpers import catmemes, get_user_from_event
from userbot.helpers.utils import _catutils, parse_pre
from userbot.plugins import BOTLOG, BOTLOG_CHATID, mention
plugin_category = "fun"
@catub.cat_cmd(
pattern="(\w+)say ([\s\S]*)",
command=("cowsay", plugin_category),
info={
"header": "A fun art plugin.",
"types": [
"default",
"beavis",
"bongcow",
"budfrogs",
"bunny",
"cheese",
"cower",
"daemon",
"dragonandcow",
"eyes",
"flamingsheep",
"ghostbusters",
"headincow",
"hellokitty",
"kiss",
"kitty",
"koala",
"kosh",
"lukekoala",
"mechandcow",
"meow",
"milk",
"moofasa",
"moose",
"mutilated",
"ren",
"satanic",
"sheep",
"skeleton",
"small",
"sodomized",
"squirrel",
"stegosaurus",
"stimpy",
"supermilker",
"surgery",
"telebears",
"threeeyes",
"turkey",
"turtle",
"tux",
"udder",
"vaderkoala",
"vader",
"www",
],
"usage": [
"{tr}cowsay <text>",
"{tr}<type>say <text>",
],
"examples": [
"{tr}squirrelsay Catuserbot",
"{tr}milksay catuserbot",
"{tr}ghostbustersghostbusterssay Catuserbot",
],
},
)
async def univsaye(cowmsg):
"A fun art plugin."
arg = cowmsg.pattern_match.group(1).lower()
text = cowmsg.pattern_match.group(2)
if arg == "cow":
arg = "default"
if arg not in cow.COWACTERS:
return await edit_delete(cowmsg, "check help menu to know the correct options.")
cheese = cow.get_cow(arg)
cheese = cheese()
await edit_or_reply(cowmsg, f"`{cheese.milk(text).replace('`', 'Β΄')}`")
@catub.cat_cmd(
pattern="coin ?([\s\S]*)",
command=("coin", plugin_category),
info={
"header": "Coin flipper.",
"usage": [
"{tr}coin <heads/tails>",
"{tr}coin",
],
},
)
async def _(event):
"flips a coin."
r = random.randint(1, 100)
input_str = event.pattern_match.group(1)
if input_str:
input_str = input_str.lower()
if r % 2 == 1:
if input_str == "heads":
await edit_or_reply(
event, "The coin landed on: **Heads**. \n You were correct."
)
elif input_str == "tails":
await edit_or_reply(
event,
"The coin landed on: **Heads**. \n You weren't correct, try again ...",
)
else:
await edit_or_reply(event, "The coin landed on: **Heads**.")
elif r % 2 == 0:
if input_str == "tails":
await edit_or_reply(
event, "The coin landed on: **Tails**. \n You were correct."
)
elif input_str == "heads":
await edit_or_reply(
event,
"The coin landed on: **Tails**. \n You weren't correct, try again ...",
)
else:
await edit_or_reply(event, "The coin landed on: **Tails**.")
else:
await edit_or_reply(event, r"Β―\_(γ)_/Β―")
@catub.cat_cmd(
pattern="slap(?:\s|$)([\s\S]*)",
command=("slap", plugin_category),
info={
"header": "To slap a person with random objects !!",
"usage": "{tr}slap reply/username>",
},
)
async def who(event):
"To slap a person with random objects !!"
replied_user, reason = await get_user_from_event(event)
if replied_user is None:
return
caption = await catmemes.slap(replied_user, event, mention)
try:
await edit_or_reply(event, caption)
except BaseException:
await edit_or_reply(
event, "`Can't slap this person, need to fetch some sticks and stones !!`"
)
@catub.cat_cmd(
pattern="(yes|no|maybe|decide)$",
command=("decide", plugin_category),
info={
"header": "To decide something will send gif according to given input or ouput.",
"usage": [
"{tr}yes",
"{tr}no",
"{tr}maybe",
"{tr}decide",
],
},
)
async def decide(event):
"To send random gif associated with yes or no or maybe."
decision = event.pattern_match.group(1).lower()
message_id = event.reply_to_msg_id or None
if decision != "decide":
r = requests.get(f"https://yesno.wtf/api?force={decision}").json()
else:
r = requests.get("https://yesno.wtf/api").json()
await event.delete()
sandy = await event.client.send_message(
event.chat_id, str(r["answer"]).upper(), reply_to=message_id, file=r["image"]
)
await _catutils.unsavegif(event, sandy)
@catub.cat_cmd(
pattern="shout(?:\s|$)([\s\S]*)",
command=("shout", plugin_category),
info={
"header": "shouts the text in a fun way",
"usage": [
"{tr}shout <text>",
],
},
)
async def shout(args):
"shouts the text in a fun way"
input_str = args.pattern_match.group(1)
if not input_str:
return await edit_delete(args, "__What should i shout?__")
words = input_str.split()
msg = ""
for messagestr in words:
text = " ".join(messagestr)
result = [" ".join(text)]
result.extend(
f"{symbol} " + " " * pos + symbol for pos, symbol in enumerate(text[1:])
)
result = list("\n".join(result))
result[0] = text[0]
result = "".join(result)
msg += "\n" + result
if len(words) > 1:
msg += "\n\n----------\n"
await edit_or_reply(args, msg, parse_mode=parse_pre)
@catub.cat_cmd(
pattern="owo ?([\s\S]*)",
command=("owo", plugin_category),
info={
"header": "check yourself.",
"usage": [
"{tr}owo <text>",
],
},
)
async def faces(owo):
"UwU"
textx = await owo.get_reply_message()
message = owo.pattern_match.group(1)
if message:
pass
elif textx:
message = textx.text
else:
return await edit_or_reply(owo, "` UwU no text given! `")
reply_text = re.sub(r"(r|l)", "w", message)
reply_text = re.sub(r"(R|L)", "W", reply_text)
reply_text = re.sub(r"n([aeiou])", r"ny\1", reply_text)
reply_text = re.sub(r"N([aeiouAEIOU])", r"Ny\1", reply_text)
reply_text = re.sub(r"\!+", f" {random.choice(catmemes.UWUS)}", reply_text)
reply_text = reply_text.replace("ove", "uv")
reply_text += f" {random.choice(catmemes.UWUS)}"
await edit_or_reply(owo, reply_text)
@catub.cat_cmd(
pattern="clap(?:\s|$)([\s\S]*)",
command=("clap", plugin_category),
info={
"header": "Praise people!",
"usage": [
"{tr}clap <text>",
],
},
)
async def claptext(event):
"Praise people!"
textx = await event.get_reply_message()
if event.pattern_match.group(1):
query = event.pattern_match.group(1)
elif textx.message:
query = textx.message
else:
return await edit_or_reply(event, "`Hah, I don't clap pointlessly!`")
reply_text = "π "
reply_text += query.replace(" ", " π ")
reply_text += " π"
await edit_or_reply(event, reply_text)
@catub.cat_cmd(
pattern="smk(?:\s|$)([\s\S]*)",
command=("smk", plugin_category),
info={
"header": "A shit module for γ , who cares.",
"usage": [
"{tr}smk <text>",
],
},
)
async def smrk(smk):
"A shit module for γ , who cares."
textx = await smk.get_reply_message()
if smk.pattern_match.group(1):
message = smk.pattern_match.group(1)
elif textx.message:
message = textx.message
else:
await edit_or_reply(smk, "γ")
return
if message == "dele":
await edit_or_reply(smk, f"{message}te the hellγ")
else:
smirk = " γ"
reply_text = message + smirk
await edit_or_reply(smk, reply_text)
@catub.cat_cmd(
pattern="f ([\s\S]*)",
command=("f", plugin_category),
info={
"header": "Pay Respects.",
"usage": [
"{tr}f <emoji/character>",
],
},
)
async def payf(event):
"Pay Respects."
paytext = event.pattern_match.group(1)
pay = f"{paytext * 8}\n{paytext * 8}\n{paytext * 2}\n{paytext * 2}\n{paytext * 2}\n{paytext * 6}\n{paytext * 6}\n{paytext * 2}\n{paytext * 2}\n{paytext * 2}\n{paytext * 2}\n{paytext * 2}"
await edit_or_reply(event, pay)
@catub.cat_cmd(
pattern="wish(?:\s|$)([\s\S]*)",
command=("wish", plugin_category),
info={
"header": "Shows the chance of your success.",
"usage": [
"{tr}wish <reply>",
"{tr}wish <your wish>",
],
},
)
async def wish_check(event):
"Shows the chance of your success."
wishtxt = event.pattern_match.group(1)
chance = random.randint(0, 100)
if wishtxt:
reslt = f"**Your wish **__{wishtxt}__ **has been cast.** β¨\
\n\n__Chance of success :__ **{chance}%**"
elif event.is_reply:
reslt = f"**Your wish has been cast. **β¨\
\n\n__Chance of success :__ **{chance}%**"
else:
reslt = "What's your Wish? Should I consider you as Idiot by default ? π"
await edit_or_reply(event, reslt)
@catub.cat_cmd(
pattern="lfy(?:\s|$)([\s\S]*)",
command=("lfy", plugin_category),
info={
"header": "Let me Google that for you real quick !!",
"usage": [
"{tr}lfy <query>",
],
},
)
async def _(event):
"Let me Google that for you real quick !!"
input_str = event.pattern_match.group(1)
reply = await event.get_reply_message()
if not input_str and reply:
input_str = reply.text
if not input_str:
return await edit_delete(
event, "`either reply to text message or give input to search`", 5
)
sample_url = f"https://da.gd/s?url=https://lmgtfy.com/?q={input_str.replace(' ', '+')}%26iie=1"
if response_api := requests.get(sample_url).text:
await edit_or_reply(
event, f"[{input_str}]({response_api.rstrip()})\n`Thank me Later π` "
)
else:
return await edit_delete(
event, "`something is wrong. please try again later.`", 5
)
if BOTLOG:
await event.client.send_message(
BOTLOG_CHATID,
f"LMGTFY query `{input_str}` was executed successfully",
)
@catub.cat_cmd(
pattern="gbun(?:\s|$)([\s\S]*)",
command=("gbun", plugin_category),
info={
"header": "Fake gban action !!",
"usage": ["{tr}gbun <reason>", "{tr}gbun"],
},
)
async def gbun(event):
"Fake gban action !!"
gbunVar = event.text
gbunVar = gbunVar[6:]
mentions = "`Warning!! User ππ½πΌππππΏ By Admin...\n`"
catevent = await edit_or_reply(event, "**Summoning out le Gungnir βοΈβοΈβ οΈ**")
await asyncio.sleep(3.5)
chat = await event.get_input_chat()
async for _ in event.client.iter_participants(
chat, filter=ChannelParticipantsAdmins
):
mentions += f""
reply_message = None
if event.reply_to_msg_id:
reply_message = await event.get_reply_message()
replied_user = await event.client.get_entity(reply_message.sender_id)
firstname = replied_user.first_name
usname = replied_user.username
idd = reply_message.sender_id
# make meself invulnerable cuz why not xD
if idd == 1035034432:
await catevent.edit(
"`Wait a second, This is my master!`\n**How dare you threaten to ban my master nigger!**\n\n__Your account has been hacked! Pay 69$ to my master__ [Ο.$](tg://user?id=1035034432) __to release your account__π"
)
else:
jnl = f"`Warning!! `[{firstname}](tg://user?id={idd})` ππ½πΌππππΏ By Admin...\n\n`**user's Name: ** __{firstname}__\n**ID : ** `{idd}`\n"
if usname is None:
jnl += "**Victim Nigga's username: ** `Doesn't own a username!`\n"
else:
jnl += "**Victim Nigga's username** : @{}\n".format(usname)
if len(gbunVar) > 0:
gbunm = f"`{gbunVar}`"
gbunr = f"**Reason: **{gbunm}"
jnl += gbunr
else:
no_reason = "__Reason: Potential spammer. __"
jnl += no_reason
await catevent.edit(jnl)
else:
mention = "`Warning!! User ππ½πΌππππΏ By Admin...\nReason: Potential spammer. `"
await catevent.edit(mention)