Пример #1
0
async def oki(event):
    await event.edit("`Processing...`")
    extra = None
    args = event.pattern_match.group(1)
    if event.reply_to_msg_id:
        previous_message = await event.get_reply_message()
        user = await event.client.get_entity(previous_message.sender_id)
        extra = event.pattern_match.group(1)
    elif args:
        args = event.pattern_match.group(1).split(" ", 1)
        userz = args[0]
        if userz.isnumeric():
            user = int(userz)
        else:
            await event.edit("Provide User-ID Not Username.")
            return
        if len(args) == 2:
            extra = args[1]
        if extra == None:
            await event.edit("Reason Can't Be None")
            return
        elif extra == "":
            await event.edit("Reason Can't Be None")
            return
        if not user:
            await event.edit("Reply To User Or Mention a User.")
            return
    try:
        sclient.ban(user, extra)
        await borg.send_message("antispamincfed", f"/fban {user} {extra}")
        await event.edit(
            f"**User :** `{user}` \n**Reason :** `{extra}` \n**Banned Sucessfully !**"
        )
    except Exception as e:
        await event.edit("Errors : " + str(e))
Пример #2
0
async def oki(event):
    lmaoded = []
    lol = event.pattern_match.group(1)
    stark = lol.split(" ", 1)
    noteme = stark[0]
    errorz = ""
    lolsed = stark[1]
    async for user in borg.iter_participants(noteme):
        lmaoded.append(user.id)
    for i in lmaoded:
        try:
            sclient.ban(i, lolsed)
            await borg.send_message("antispamincfed", f"/fban {i} {lolsed}")
        except:
            errorz += 1
        await event.edit(
            f"**User :** `{i}` \n**Banned Sucessfully !** \n**Failed :** `{len(errorz)}`"
        )
    await event.edit("**DONE !**")
async def oki(event):
    if event.fwd_from:
        return
    await event.edit("`Processing...`")
    extra = None
    args = event.pattern_match.group(1)
    if event.reply_to_msg_id:
        previous_message = await event.get_reply_message()
        user = await borg.get_entity(previous_message.sender_id)
        extra = event.pattern_match.group(1)
    elif args:
        args = event.pattern_match.group(1).split(" ", 1)
        userz = args[0]
        if userz.isnumeric():
            user = int(userz)
        else:
            try:
                userm = await event.client(GetFullUserRequest(userz))
                user = userm.user.id
            except:
                await event.edit("<i>No User Found.</i>", parse_mode="HTML")
                return
        if len(args) == 2:
            extra = args[1]
        if not json_codes.get(extra):
            await event.edit('`Please Use Valid Ban Codes.`')
            return
        if not user:
            await event.edit("Reply To User Or Mention a User.")
            return
    try:
        sclient.ban(user, extra)
        await borg.send_message("nospamplusfed",
                                f"/fban {user} {extra} {json_codes[extra]}")
        await event.edit(
            f"**User :** `{user}` \n**Reason :** `{extra} {json_codes[extra]}` \n**Banned Sucessfully !**"
        )
    except Exception as e:
        await event.edit("**Errors : **" + str(e))
Пример #4
0
async def oki(event):
    lmaoded = []
    lol = event.pattern_match.group(1)
    stark = lol.split(" ", 1)
    noteme = stark[0]
    errorz = ""
    lolsed = stark[1]
    async for user in borg.iter_participants(noteme):
        lmaoded.append(user.id)
    for i in lmaoded:
        gensys2 = sclient.ban(i, lolsed)
        await borg.send_message("antispamincfed", f"/fban {i} {lolsed}")
        if gensys2["error"] == True:
            errorz += gensys2["full"]
        else:
            await event.edit(f"**User :** `{i}` \n**Banned Sucessfully !**")
        await event.edit("Mass Ban Completed.")