Beispiel #1
0
async def gspider(gspdr):
    """ For .gmute command, globally mutes the replied/tagged person """
    # Admin or creator check
    chat = await gspdr.get_chat()
    admin = chat.admin_rights
    creator = chat.creator

    # If not admin and not creator, return
    if not admin and not creator:
        await gspdr.edit_or_reply(NO_ADMIN)
        return

    # Check if the function running under SQL mode
    try:
        from jarvis.modules.sql_helper.gmute_sql import gmute
    except AttributeError:
        await gspdr.edit(NO_SQL)
        return

    user, reason = await get_user_from_event(gspdr)
    if user:
        pass
    else:
        return

    # If pass, inform and start gmuting
    await gspdr.edit("`Grabs a huge, sticky tape!`")
    if gmute(user.id) is False:
        await gspdr.edit(
            "`Error! User probably already gmuted.\nRe-rolls the tape.`")
    else:
        if reason:
            await gspdr.edit(f"`Globally taped!`Reason: {reason}")
        else:
            await gspdr.edit("`Globally taped!`")

        if BOTLOG:
            await gspdr.client.send_message(
                BOTLOG_CHATID,
                "#GMUTE\n"
                f"USER: [{user.first_name}](tg://user?id={user.id})\n"
                f"CHAT: {gspdr.chat.title}(`{gspdr.chat_id}`)",
            )
Beispiel #2
0
async def gspider(userbot):
    lol = userbot
    sender = await lol.get_sender()
    me = await lol.client.get_me()
    if not sender.id == me.id:
        jarvis = await lol.reply("Gbanning This User !")
    else:
        jarvis = await lol.edit("Wait Processing.....")
    me = await userbot.client.get_me()
    await jarvis.edit(f"Global Ban Is Coming ! Wait And Watch You N***a")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    my_username = f"@{me.username}" if me.username else my_mention
    chat = await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
        chat_title = 'PM'
    else:
        chat_title = userbot.chat.title
    try:
        user, reason = await get_user_from_event(userbot)
    except:
        pass
    try:
        if not reason:
            reason = 'Private'
    except:
        return await jarvis.edit(f"**You Cant Use In Pvt Chats // Group!**")
    if user:
        if user.id == 1263617196:
            return await jarvis.edit(
                f"**Didn't , Your Father Teach You ? That You Cant Gban Dev**")
        try:
            from jarvis.modules.sql_helper.gmute_sql import gmute
        except:
            pass
        try:
            await userbot.client(BlockRequest(user))
            block = 'True'
        except:
            pass
        testuserbot = [
            d.entity.id for d in await userbot.client.get_dialogs()
            if (d.is_group or d.is_channel)
        ]
        for i in testuserbot:
            try:
                await userbot.client.edit_permissions(i,
                                                      user,
                                                      view_messages=False)
                a += 1
                await jarvis.edit(
                    f"**GBANNED // Total Affected Chats **: `{a}`")
            except:
                b += 1
    else:
        await jarvis.edit(f"**Reply to a user !!**")
    try:
        if gmute(user.id) is False:
            return await jarvis.edit(
                f"**Error! User probably already gbanned.**")
    except:
        pass
    return await jarvis.edit(
        f"**Gbanned [{user.first_name}](tg://user?id={user.id}) Affected Chats : {a} **"
    )
async def gben(userjbot):
    dc = userjbot
    sender = await dc.get_sender()
    me = await dc.client.get_me()
    if not sender.id == me.id:
        dark = await dc.reply("Gbanning This User !")
    else:
        dark = await dc.edit("Wait Processing.....")
    me = await userjbot.client.get_me()
    await dark.edit(f"Trying to ban you globally..weit nd watch you nub nibba")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await userjbot.get_chat()
    a = b = 0
    if userjbot.is_private:
        user = userjbot.chat
        reason = userjbot.pattern_match.group(1)
    else:
        userjbot.chat.title
    try:
        user, reason = await get_full_user(userjbot)
    except:
        pass
    try:
        if not reason:
            reason = "Private"
    except:
        return await dark.edit(f"**Something W3NT Wrong 🤔**")
    if user:
        if user.id == 1318486004:
            return await dark.edit(f"**You nub nibba..I can't gben my creator..**")
        try:
            from jarvis.modules.sql_helper.gmute_sql import gmute
        except:
            pass
        try:
            await userjbot.client(BlockRequest(user))
        except:
            pass
        testuserjbot = [
            d.entity.id
            for d in await userjbot.client.get_dialogs()
            if (d.is_group or d.is_channel)
        ]
        for i in testuserjbot:
            try:
                await userjbot.client.edit_permissions(i, user, view_messages=False)
                a += 1
                await dark.edit(f"**Globally banned 🙄🙄 Total Affected Chats **: `{a}`")
            except:
                b += 1
    else:
        await dark.edit(f"**Reply to a user you dumbo !!**")
    try:
        if gmute(user.id) is False:
            return await dark.edit(f"**Error! User already gbanned.**")
    except:
        pass
    return await dark.edit(
        f"**Globally banned this nub nibba [{user.first_name}](tg://user?id={user.id}) Affected Chats😏 : {a} **"
    )