예제 #1
0
async def gspider(gspdr):
    """ For .gmute command, globally mutes the replied/tagged person """
    await gspdr.get_chat()
    try:
        from fridaybot.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}`)",
            )
예제 #2
0
async def gspider(fridaybot):
    lol = fridaybot
    sender = await lol.get_sender()
    me = await lol.client.get_me()
    if not sender.id == me.id:
        friday = await lol.reply("Gbanning This User !")
    else:
        friday = await lol.edit("Wait Processing.....")
    me = await fridaybot.client.get_me()
    await friday.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 fridaybot.get_chat()
    a = b = 0
    if fridaybot.is_private:
        user = fridaybot.chat
        reason = fridaybot.pattern_match.group(1)
    else:
        fridaybot.chat.title
    try:
        user, reason = await get_full_user(fridaybot)
    except:
        pass
    try:
        if not reason:
            reason = "Private"
    except:
        return await friday.edit(f"**Something W3NT Wrong 🤔**")
    if user:
        if user.id == 1263617196:
            return await friday.edit(
                f"**Didn't , Your Father Teach You ? That You Cant Gban Dev**")
        try:
            from fridaybot.modules.sql_helper.gmute_sql import gmute
        except:
            pass
        try:
            await fridaybot.client(BlockRequest(user))
        except:
            pass
        testfridaybot = [
            d.entity.id for d in await fridaybot.client.get_dialogs()
            if (d.is_group or d.is_channel)
        ]
        for i in testfridaybot:
            try:
                await fridaybot.client.edit_permissions(i,
                                                        user,
                                                        view_messages=False)
                a += 1
                await friday.edit(
                    f"**GBANNED // Total Affected Chats **: `{a}`")
            except:
                b += 1
    else:
        await friday.edit(f"**Reply to a user !!**")
    try:
        if gmute(user.id) is False:
            return await friday.edit(
                f"**Error! User probably already gbanned.**")
    except:
        pass
    return await friday.edit(
        f"**Gbanned [{user.first_name}](tg://user?id={user.id}) Affected Chats : {a} **"
    )