-
Notifications
You must be signed in to change notification settings - Fork 0
/
Spam.py
82 lines (72 loc) · 3.15 KB
/
Spam.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
from .. import loader, utils
from asyncio import sleep, gather
def register(cb):
cb(SpamMod())
class SpamMod(loader.Module):
"""Спам модуль"""
strings = {'name': 'Spam'}
async def spamcmd(self, message):
"""Обычный спам. Используй .spam <кол-во:int> <текст или реплай>."""
try:
await message.delete()
args = utils.get_args(message)
count = int(args[0].strip())
reply = await message.get_reply_message()
if reply:
if reply.media:
for _ in range(count):
await message.client.send_file(message.to_id, reply.media)
return
else:
for _ in range(count):
await message.client.send_message(message.to_id, reply)
else:
message.message = " ".join(args[1:])
for _ in range(count):
await gather(*[message.respond(message)])
except: return await message.client.send_message(message.to_id, '.spam <кол-во:int> <текст или реплай>.')
async def cspamcmd(self, message):
"""Спам символами. Используй .cspam <текст или реплай>."""
await message.delete()
reply = await message.get_reply_message()
if reply:
msg = reply.text
else:
msg = utils.get_args_raw(message)
msg = msg.replace(' ', '')
for m in msg:
await message.respond(m)
async def wspamcmd(self, message):
"""Спам словами. Используй .wspam <текст или реплай>."""
await message.delete()
reply = await message.get_reply_message()
if reply:
msg = reply.text
else:
msg = utils.get_args_raw(message)
msg = msg.split()
for m in msg:
await message.respond(m)
async def delayspamcmd(self, message):
"""Спам с задержкой. Используй .delayspam <время:int> <кол-во:int> <текст или реплай>."""
try:
await message.delete()
args = utils.get_args_raw(message)
reply = await message.get_reply_message()
time = int(args.split(' ', 2)[0])
count = int(args.split(' ', 2)[1])
if reply:
if reply.media:
for _ in range(count):
await message.client.send_file(message.to_id, reply.media, reply_to=reply.id)
await sleep(time)
else:
for _ in range(count):
await reply.reply(args.split(' ', 2)[2])
await sleep(time)
else:
spammsg = args.split(' ', 2)[2]
for _ in range(count):
await message.respond(spammsg)
await sleep(time)
except: return await message.client.send_message(message.to_id, '.delayspam <время:int> <кол-во:int> <текст или реплай>')