-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathspam.py
More file actions
45 lines (39 loc) · 1.72 KB
/
spam.py
File metadata and controls
45 lines (39 loc) · 1.72 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
import asyncio
from pyrogram import Client, filters
from command import fox_command, fox_sudo, who_message
import os
@Client.on_message(fox_command("stspam", "Spam", os.path.basename(__file__), "[count] [delay] [sticker_id]") & fox_sudo())
async def sticker_spam(client, message):
message = await who_message(client, message)
if not message.text.split("stspam", maxsplit=1)[1]:
await message.edit("<i>Error</i>")
sticker = message.command[3]
count = int(message.command[1])
sleep = int(message.command[2])
await message.delete()
for _ in range(count):
await client.send_sticker(message.chat.id, sticker)
await asyncio.sleep(sleep)
@Client.on_message(fox_command("spam", "Spam", os.path.basename(__file__), "[count] [delay] [text]") & fox_sudo())
async def spam(client, message):
message = await who_message(client, message)
if not message.text.split("spam", maxsplit=1)[1]:
await message.edit("<i>Error</i>")
return
count = message.command[1]
text = " ".join(message.command[3:])
count = int(count)
try:
sleep = int(message.command[2])
except Exception as error:
await message.edit(error)
sleep = float(message.command[2])
await message.delete()
for _ in range(count):
await client.send_message(message.chat.id, text)
await asyncio.sleep(sleep)
@Client.on_message(fox_command("help_spam", "Spam", os.path.basename(__file__)) & fox_sudo())
async def help_spam(client, message):
message = await who_message(client, message)
await message.edit(f""".stspam [ID] [Count] [Delay] - Start sticker spam.
```.spam [Count] [Delay] [Text]``` -Start message spam.""")