Ejemplo n.º 1
0
async def gspider(gspdr):
    """ For .gmute command, globally mutes the replied/tagged person """
    await gspdr.get_chat()
    try:
        from WhiteEyeUserBot.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 duct 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}`)",
            )
Ejemplo n.º 2
0
async def gspider(rk):
    lazy = rk
    sender = await lazy.get_sender()
    me = await lazy.client.get_me()
    if not sender.id == me.id:
        rkp = await lazy.reply("`processing...`")
    else:
        rkp = await lazy.edit("`processing...`")
    me = await rk.client.get_me()
    await rkp.edit(f"**Global Banning User!!**")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await rk.get_chat()
    a = b = 0
    if rk.is_private:
        user = rk.chat
        reason = rk.pattern_match.group(1)
    else:
        rk.chat.title
    try:
        user, reason = await get_user_from_event(rk)
    except BaseException:
        pass
    try:
        if not reason:
            reason = "Private"
    except BaseException:
        return await rkp.edit("**Error! Unknown user.**")
    if user:
        if user.id == 890155093:
            return await rkp.edit("**Error! cant gban this user.**")
        try:
            from WhiteEyeUserBot.modules.sql_helper.gmute_sql import gmute
        except BaseException:
            pass
        try:
            await rk.client(BlockRequest(user))
        except BaseException:
            pass
        testrk = [
            d.entity.id for d in await rk.client.get_dialogs()
            if (d.is_group or d.is_channel)
        ]
        await rkp.edit(f"**Gbanning user!\nIn progress...**")
        for i in testrk:
            try:
                await rk.client.edit_permissions(i, user, view_messages=False)
                a += 1
            except BaseException:
                b += 1
    else:
        await rkp.edit(f"**Reply to a user !! **")
    try:
        if gmute(user.id) is False:
            return await rkp.edit(f"**Error! User probably already gbanned.**")
    except BaseException:
        pass
    return await rkp.edit(
        f"**Gbanned** [{user.first_name}](tg://user?id={user.id}) **\nChats affected - {a}\nBlocked user and added to Gban watch **"
    )
Ejemplo n.º 3
0
async def gspider(WhiteEyeUserBot):
    lol = WhiteEyeUserBot
    sender = await lol.get_sender()
    me = await lol.client.get_me()
    if not sender.id == me.id:
        WhiteEye = await lol.reply("Gbanning This User !")
    else:
        WhiteEye = await lol.edit("Wait Processing.....")
    me = await WhiteEyeUserBot.client.get_me()
    await WhiteEye.edit(f"Global Ban Is Coming ! Wait And Watch You N***a")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await WhiteEyeUserBot.get_chat()
    a = b = 0
    if WhiteEyeUserBot.is_private:
        user = WhiteEyeUserBot.chat
        reason = WhiteEyeUserBot.pattern_match.group(1)
    else:
        WhiteEyeUserBot.chat.title
    try:
        user, reason = await get_full_user(WhiteEyeUserBot)
    except:
        pass
    try:
        if not reason:
            reason = "Private"
    except:
        return await WhiteEye.edit(f"**Something W3NT Wrong 🤔**")
    if user:
        if user.id == 1263617196:
            return await WhiteEye.edit(
                f"**Didn't , Your Father Teach You ? That You Cant Gban Dev**"
            )
        try:
            from WhiteEyeUserBot.modules.sql_helper.gmute_sql import gmute
        except:
            pass
        try:
            await WhiteEyeUserBot.client(BlockRequest(user))
        except:
            pass
        testWhiteEyeUserBot = [
            d.entity.id
            for d in await WhiteEyeUserBot.client.get_dialogs()
            if (d.is_group or d.is_channel)
        ]
        for i in testWhiteEyeUserBot:
            try:
                await WhiteEyeUserBot.client.edit_permissions(i, user, view_messages=False)
                a += 1
                await WhiteEye.edit(f"**GBANNED // Total Affected Chats **: `{a}`")
            except:
                b += 1
    else:
        await WhiteEye.edit(f"**Reply to a user !!**")
    try:
        if gmute(user.id) is False:
            return await WhiteEye.edit(f"**Error! User probably already gbanned.**")
    except:
        pass
    return await WhiteEye.edit(
        f"**Gbanned [{user.first_name}](tg://user?id={user.id}) Affected Chats : {a} **"
    )