File size: 1,060 Bytes
21bc372
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import asyncio

from pyrogram import Client
from pyrogram import *
from pyrogram.types import *
from akn.utils.handler import *
from akn.utils.prefixprem import command
from config import *


@Akeno(
    ~filters.scheduled
    & command(["limit", "limited"])
    & filters.me
    & ~filters.forwarded
)
async def spamban(client: Client, message: Message):
    await client.unblock_user("SpamBot")
    response = await client.invoke(
        raw.functions.messages.StartBot(
            bot=await client.resolve_peer("SpamBot"),
            peer=await client.resolve_peer("SpamBot"),
            random_id=client.rnd_id(),
            start_param="start",
        )
    )
    wait_msg = await message.reply_text("`Processing . . .`")
    await asyncio.sleep(1)
    spambot_msg = response.updates[1].message.id + 1
    status = await client.get_messages(chat_id="SpamBot", message_ids=spambot_msg)
    await wait_msg.edit_text(f"~ {status.text}")

module = modules_help.add_module("limited", __file__)
module.add_command("limit", "to limit spam from @spambot.")