forked from TeamUltroid/UltroidAddons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspam.py
More file actions
92 lines (75 loc) · 2.4 KB
/
spam.py
File metadata and controls
92 lines (75 loc) · 2.4 KB
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
# Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
"""
✘ Commands Available -
• `{i}spam <no of msgs> <your msg>`
spams chat, the current limit for this is from 1 to 99.
• `{i}bigspam <no of msgs> <your msg>`
Spams chat, the current limit is above 100.
• `{i}picspam <no of spam> <reply to media>`
Spam media.
• `{i}delayspam <delay time> <count> <msg>`
Spam chat.
"""
import asyncio
import os
from . import *
@ultroid_cmd(pattern="tspam")
async def tmeme(e):
tspam = str(e.text[7:])
message = tspam.replace(" ", "")
for letter in message:
await e.respond(letter)
await e.delete()
@ultroid_cmd(pattern="spam")
async def spammer(e):
message = e.text
if not len(message) > 5:
return await eod(e, "`Use in Proper Format`")
counter = int(message[6:8])
spam_message = str(e.text[8:])
await asyncio.wait([e.respond(spam_message) for i in range(counter)])
await e.delete()
@ultroid_cmd(pattern="bigspam")
async def bigspam(e):
message = e.text
try:
counter = int(message[9:13])
except (ValueError, IndexError):
return await eod(e,
"Invalid Input Given, or Value is below 101"
)
spam_message = str(e.text[13:])
for i in range(1, counter):
await e.respond(spam_message)
await e.delete()
@ultroid_cmd(pattern="picspam")
async def tiny_pic_spam(e):
reply = await e.get_reply_message()
text = e.text.split()
counter = int(text[1])
media = await e.client.download_media(reply)
for i in range(1, counter):
await e.client.send_file(e.chat_id, media)
os.remove(media)
await e.delete()
@ultroid_cmd(pattern="delayspam ?(.*)")
async def delayspammer(e):
try:
args = e.text.split(" ", 3)
delay = float(args[1])
count = int(args[2])
msg = str(args[3])
except BaseException:
return await e.edit(f"**Usage :** {HNDLR}delayspam <delay time> <count> <msg>")
await e.delete()
try:
for i in range(count):
await e.respond(msg)
await asyncio.sleep(delay)
except Exception as u:
await e.respond(f"**Error :** `{u}`")