Example #1
0
async def unblockpm(unblock):
    match = unblock.pattern_match.group(1)
    if unblock.is_reply:
        reply = await unblock.get_reply_message()
        user = reply.sender_id
    elif match:
        user = await get_user_id(match)
    else:
        return await eod(unblock, NO_REPLY)
    try:
        await unblock.client(UnblockRequest(user))
        aname = await unblock.client.get_entity(user)
        await eor(unblock, f"`{aname.first_name} has been UnBlocked!`")
    except Exception as et:
        await eod(unblock, f"ERROR - {str(et)}")
    await asst.edit_message(
        int(udB.get("LOG_CHANNEL")),
        _not_approved[user],
        f"#UNBLOCKED\n\n[{aname.first_name}](tg://user?id={user}) has been **unblocked**.",
        buttons=[
            Button.inline("Block", data=f"block_{user}"),
            Button.inline("Close", data="deletedissht"),
        ],
    )
Example #2
0
async def unblockpm(unblock):
    """ For .unblock command, let people PMing you again! """
    if not unblock.text[0].isalpha() and unblock.text[0] \
            not in ("/", "#", "@", "!") and unblock.reply_to_msg_id:
        if unblock.reply_to_msg_id:
            reply = await unblock.get_reply_message()
            replied_user = await unblock.client(
                GetFullUserRequest(reply.from_id))
            name0 = str(replied_user.user.first_name)
            if await approve(reply.from_id) is False:
                return await unblock.edit(
                    "`You haven't blocked this user yet!`")
            else:
                return await unblock.edit(
                    "`My Master has forgiven you to PM now`")

            await unblock.client(UnblockRequest(replied_user.user.id))

        if BOTLOG:
            await unblock.client.send_message(
                BOTLOG_CHATID,
                f"[{name0}](tg://user?id={replied_user.user.id})"
                " was unblocc'd!.",
            )
Example #3
0
async def newbot(event):
    if event.pattern_match.group(1):
        text, username = event.pattern_match.group(1).split()

    else:
        await event.edit(LANG["ERROR"])
        return

    async with event.client.conversation("@BotFather") as conv:
        try:
            await conv.send_message("/newbot")
            audio = await conv.get_response()
            await conv.send_message(text)
            audio = await conv.get_response()
            await conv.send_message(username)
            audio = await conv.get_response()
            if BOTLOG_CHATID:
                await event.client.forward_messages(BOTLOG_CHATID, audio)
                await event.edit('✅ Send to Botlog')
            else:
                await event.client.forward_messages(event.chat_id, audio)
                await event.delete()
        except YouBlockedUserError:
            await event.client(UnblockRequest("93372553"))
            await conv.send_message("/newbot")
            audio = await conv.get_response()
            await conv.send_message(text)
            audio = await conv.get_response()
            await conv.send_message(username)
            audio = await conv.get_response()
            if BOTLOG_CHATID:
                await event.client.forward_messages(BOTLOG_CHATID, audio)
                await event.edit('✅ Send to Botlog')
            else:
                await event.client.forward_messages(event.chat_id, audio)
                await event.delete()
Example #4
0
async def _(event):
    xxnx = event.pattern_match.group(1)
    if xxnx:
        d_link = xxnx
    elif event.is_reply:
        d_link = await event.get_reply_message()
    else:
        return await edit_delete(
            event,
            "**Berikan Link Tiktok Pesan atau Reply Link Tiktok Untuk di Download**",
        )
    xx = await edit_or_reply(event, "`Video Sedang Diproses...`")
    chat = "@thisvidbot"
    async with event.client.conversation(chat) as conv:
        try:
            msg_start = await conv.send_message("/start")
            r = await conv.get_response()
            msg = await conv.send_message(d_link)
            details = await conv.get_response()
            video = await conv.get_response()
            text = await conv.get_response()
            await event.client.send_read_acknowledge(conv.chat_id)
        except YouBlockedUserError:
            await event.client(UnblockRequest(chat))
            msg_start = await conv.send_message("/start")
            r = await conv.get_response()
            msg = await conv.send_message(d_link)
            details = await conv.get_response()
            video = await conv.get_response()
            text = await conv.get_response()
            await event.client.send_read_acknowledge(conv.chat_id)
        await event.client.send_file(event.chat_id, video)
        await event.client.delete_messages(
            conv.chat_id,
            [msg_start.id, r.id, msg.id, details.id, video.id, text.id])
        await xx.delete()
Example #5
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("`Wait Let Me Process`")
    else:
        jarvis = await lol.edit("One Min ! ")
    me = await userbot.client.get_me()
    await jarvis.edit(f"Trying To Ungban User !")
    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("Use In Public Chats , Or In PM")
    if user:
        if user.id == 1263617196:
            return await jarvis.edit("**You Cant Ungban A Dev !**")
        try:
            from jarvis.modules.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await userbot.client(UnblockRequest(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,
                                                      send_messages=True)
                a += 1
                await jarvis.edit(f"**UNGBANNING // AFFECTED CHATS - {a} **")
            except:
                b += 1
    else:
        await jarvis.edit("**Reply to a user !!**")
    try:
        if ungmute(user.id) is False:
            return await jarvis.edit(
                "**Error! User probably already ungbanned.**")
    except:
        pass
    return await jarvis.edit(
        f"**UNGBANNED // USER - [{user.first_name}](tg://user?id={user.id}) CHATS : {a} **"
    )
Example #6
0
    if BOTLOG:
        await block.client.send_message(
            BOTLOG_CHATID,
            "#BLOCKED\n" + "User: "******"[{name0}](tg://user?id={uid})",
        )


@register(outgoing=True, pattern="^.unblock$")
async def unblockpm(unblock):
    """ For .unblock command, let people PMing you again! """
    if unblock.reply_to_msg_id:
        reply = await unblock.get_reply_message()
        replied_user = await unblock.client.get_entity(reply.from_id)
        name0 = str(replied_user.first_name)
        await unblock.client(UnblockRequest(replied_user.id))
        await unblock.edit("`You has been unblocked.`")

    if BOTLOG:
        await unblock.client.send_message(
            BOTLOG_CHATID,
            f"[{name0}](tg://user?id={replied_user.id})"
            " was unblocc'd!.",
        )


CMD_HELP.update({
    "pmpermit":
    "\
.approve\
\nUsage: Approves the mentioned/replied person to PM.\
Example #7
0
File: gbans.py Project: ez69bw/ezbw
async def gunben(userbot):
    dc = userbot
    sender = await dc.get_sender()
    me = await dc.client.get_me()
    if not sender.id == me.id:
        dark = await dc.reply("`Membatalkan Perintah Global Banned!`")
    else:
        dark = await dc.edit("`↺ Membatalkan Perintah Global Banned!`")
    me = await userbot.client.get_me()
    await dark.edit(f"`↺ Memulai Membatalkan Perintah Global Banned.`")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except BaseException:
        pass
    try:
        if not reason:
            reason = "Private"
    except BaseException:
        return await dark.edit("`Terjadi Kesalahan ヅ`")
    if user:
        if user.id == 1626664284:
            return await dark.edit(
                f"`✗ Global Banned Gagal, Dia Adalah Paris Yang Membuat 𝙚𝙯𝙗𝙬!`"
            )
    if user:
        if user.id == 1317838294:
            return await dark.edit(
                f"`✗ Global Banned Gagal, Dia Adalah Paris Yang Membuat 𝙚𝙯𝙗𝙬!`"
            )
    if user:
        if user.id == 1317838294:
            return await dark.edit(
                f"`✗ Global Banned Gagal, Dia Adalah Paris Yang Membuat 𝙚𝙯𝙗𝙬!`"
            )
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except BaseException:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        except BaseException:
            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,
                                                      send_messages=True)
                a += 1
                await dark.edit(f"`↺ Memproses Pembatalan Global Banned!`")
            except BaseException:
                b += 1
    else:
        await dark.edit("`Reply Ke Korban`")
    try:
        if ungmute(user.id) is False:
            return await dark.edit(
                "**Kesalahan! Pengguna Sedang Tidak Di Global Banned.**")
    except BaseException:
        pass
    return await dark.edit(
        f"**⋖ UN GLOBAL BAN ⋗**\n\n**ᴜꜱᴇʀ      :** `{ALIVE_NAME}`\n**ᴛᴀʀɢᴇᴛ  :** [{user.first_name}](tg://user?id={user.id})\n**ʀᴇᴀꜱᴏɴ  :** **YATIM KASIAN**"
    )
Example #8
0
async def gspider(ULTRA):
    lol = ULTRA
    sender = await lol.get_sender()
    me = await lol.client.get_me()
    if not sender.id == me.id:
        friday = await lol.reply("`Wait Let Me Process`")
    else:
        friday = await lol.edit("Just a Second ")
    me = await ULTRA.client.get_me()
    await friday.edit(f"Trying To Ungban User !")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await ULTRA.get_chat()
    a = b = 0
    if ULTRA.is_private:
        user = ULTRA.chat
        reason = ULTRA.pattern_match.group(1)
    else:
        ULTRA.chat.title
    try:
        user, reason = await get_full_user(ULTRA)
    except:
        pass
    try:
        if not reason:
            reason = "Private"
    except:
        return await friday.edit("**SOMETHING W3NT WRONG 🤔**")
    if user:
        if user.id in SUDOERS:
            return await friday.edit(
                "**You Cant gban him... as a result you can not ungban him... He is My Creator!**"
            )
        try:
            from DaisyX.modules.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await ULTRA.client(UnblockRequest(user))
        except:
            pass
        testULTRA = [
            d.entity.id for d in await ULTRA.client.get_dialogs()
            if (d.is_group or d.is_channel)
        ]
        for i in testULTRA:
            try:
                await ULTRA.client.edit_permissions(i,
                                                    user,
                                                    send_messages=True)
                a += 1
                await friday.edit(
                    f"**UNGBANNING [{user.first_name}](tg://user?id={user.id})**\n\n__Please be Patient..This process takes time.__"
                )
            except:
                b += 1
    else:
        await friday.edit("**Reply to a user !!**")
    try:
        if ungmute(user.id) is False:
            return await friday.edit(
                "**Error! User probably already ungbanned.**")
    except:
        pass
    return await friday.edit(
        f"**Successfully UnGBanned // USER - [{user.first_name}](tg://user?id={user.id}) IN CHATS :** `{a}`"
    )
Example #9
0
async def kang(args):
    user = await args.client.get_me()
    if not user.username:
        user.username = user.first_name
    message = await args.get_reply_message()
    photo = None
    emojibypass = False
    is_video = False
    is_anim = False
    emoji = None

    if not message:
        return await edit_delete(
            args,
            "**Silahkan Reply Ke Pesan Media Untuk Mencuri Sticker itu!**")

    if isinstance(message.media, MessageMediaPhoto):
        xx = await edit_or_reply(args, f"`{choice(KANGING_STR)}`")
        photo = io.BytesIO()
        photo = await args.client.download_media(message.photo, photo)
    elif isinstance(message.media, MessageMediaUnsupported):
        await edit_delete(
            args,
            "**File Tidak Didukung, Silahkan Reply ke Media Foto/GIF !**")
    elif message.file and "image" in message.file.mime_type.split("/"):
        xx = await edit_or_reply(args, f"`{choice(KANGING_STR)}`")
        photo = io.BytesIO()
        await args.client.download_file(message.media.document, photo)
        if (DocumentAttributeFilename(file_name="sticker.webp")
                in message.media.document.attributes):
            emoji = message.media.document.attributes[1].alt
            if emoji != "✨":
                emojibypass = True
    elif message.file and "tgsticker" in message.file.mime_type:
        xx = await edit_or_reply(args, f"`{choice(KANGING_STR)}`")
        await args.client.download_file(message.media.document,
                                        "AnimatedSticker.tgs")
        attributes = message.media.document.attributes
        for attribute in attributes:
            if isinstance(attribute, DocumentAttributeSticker):
                emoji = attribute.alt
        emojibypass = True
        is_anim = True
        photo = 1
    elif message.media.document.mime_type in ["video/mp4", "video/webm"]:
        if message.media.document.mime_type == "video/webm":
            xx = await edit_or_reply(args, f"`{choice(KANGING_STR)}`")
            await args.client.download_media(message.media.document,
                                             "Video.webm")
        else:
            xx = await edit_or_reply(args, "`Downloading...`")
            await animator(message, args, xx)
            await xx.edit(f"`{choice(KANGING_STR)}`")
        is_video = True
        emoji = "✨"
        emojibypass = True
        photo = 1
    else:
        return await edit_delete(
            args,
            "**File Tidak Didukung, Silahkan Reply ke Media Foto/GIF !**")
    if photo:
        splat = args.text.split()
        if not emojibypass:
            emoji = "✨"
        pack = 1
        if len(splat) == 3:
            pack = splat[2]
            emoji = splat[1]
        elif len(splat) == 2:
            if splat[1].isnumeric():
                pack = int(splat[1])
            else:
                emoji = splat[1]

        packname = f"Sticker_u{user.id}_Ke{pack}"
        if custompack is not None:
            packnick = f"{custompack}"
        else:
            f_name = f"@{user.username}" if user.username else user.first_name
            packnick = f"Sticker Pack {f_name}"

        cmd = "/newpack"
        file = io.BytesIO()

        if is_video:
            packname += "_vid"
            packnick += " (Video)"
            cmd = "/newvideo"
        elif is_anim:
            packname += "_anim"
            packnick += " (Animated)"
            cmd = "/newanimated"
        else:
            image = await resize_photo(photo)
            file.name = "sticker.png"
            image.save(file, "PNG")

        response = urllib.request.urlopen(
            urllib.request.Request(f"http://t.me/addstickers/{packname}"))
        htmlstr = response.read().decode("utf8").split("\n")

        if ("  A <strong>Telegram</strong> user has created the <strong>Sticker&nbsp;Set</strong>."
                not in htmlstr):
            async with args.client.conversation("@Stickers") as conv:
                try:
                    await conv.send_message("/addsticker")
                except YouBlockedUserError:
                    await args.client(UnblockRequest("@Stickers"))
                    await conv.send_message("/addsticker")
                await conv.get_response()
                await args.client.send_read_acknowledge(conv.chat_id)
                await conv.send_message(packname)
                x = await conv.get_response()
                limit = "50" if (is_anim or is_video) else "120"
                while limit in x.text:
                    pack += 1
                    if custompack is not None:
                        packname = f"Sticker_u{user.id}_Ke{pack}"
                        packnick = f"{custompack}"
                    else:
                        f_name = (f"@{user.username}"
                                  if user.username else user.first_name)
                        packname = f"Sticker_u{user.id}_Ke{pack}"
                        packnick = f"Sticker Pack {f_name}"
                    await xx.edit("`Membuat Sticker Pack Baru " + str(pack) +
                                  " Karena Sticker Pack Sudah Penuh`")
                    await conv.send_message(packname)
                    x = await conv.get_response()
                    if x.text == "Gagal Memilih Pack.":
                        await conv.send_message(cmd)
                        await conv.get_response()
                        await args.client.send_read_acknowledge(conv.chat_id)
                        await conv.send_message(packnick)
                        await conv.get_response()
                        await args.client.send_read_acknowledge(conv.chat_id)
                        if is_anim:
                            await conv.send_file("AnimatedSticker.tgs")
                            remove("AnimatedSticker.tgs")
                        elif is_video:
                            await conv.send_file("Video.webm")
                            remove("Video.webm")
                        else:
                            file.seek(0)
                            await conv.send_file(file, force_document=True)
                        await conv.get_response()
                        await conv.send_message(emoji)
                        await args.client.send_read_acknowledge(conv.chat_id)
                        await conv.get_response()
                        await conv.send_message("/publish")
                        if is_anim:
                            await conv.get_response()
                            await conv.send_message(f"<{packnick}>")
                        await conv.get_response()
                        await args.client.send_read_acknowledge(conv.chat_id)
                        await conv.send_message("/skip")
                        await args.client.send_read_acknowledge(conv.chat_id)
                        await conv.get_response()
                        await conv.send_message(packname)
                        await args.client.send_read_acknowledge(conv.chat_id)
                        await conv.get_response()
                        await args.client.send_read_acknowledge(conv.chat_id)
                        return await xx.edit(
                            "`Sticker ditambahkan ke pack yang berbeda !"
                            "\nIni pack yang baru saja dibuat!"
                            f"\nTekan [Sticker Pack](t.me/addstickers/{packname}) Untuk Melihat Sticker Pack",
                            parse_mode="md",
                        )
                if is_anim:
                    await conv.send_file("AnimatedSticker.tgs")
                    remove("AnimatedSticker.tgs")
                elif is_video:
                    await conv.send_file("Video.webm")
                    remove("Video.webm")
                else:
                    file.seek(0)
                    await conv.send_file(file, force_document=True)
                rsp = await conv.get_response()
                if "Sorry, the file type is invalid." in rsp.text:
                    return await xx.edit(
                        "**Gagal Menambahkan Sticker, Gunakan @Stickers Bot Untuk Menambahkan Sticker Anda.**"
                    )
                await conv.send_message(emoji)
                await args.client.send_read_acknowledge(conv.chat_id)
                await conv.get_response()
                await conv.send_message("/done")
                await conv.get_response()
                await args.client.send_read_acknowledge(conv.chat_id)
        else:
            await xx.edit("`Membuat Sticker Pack Baru`")
            async with args.client.conversation("@Stickers") as conv:
                try:
                    await conv.send_message(cmd)
                except YouBlockedUserError:
                    await args.client(UnblockRequest("@Stickers"))
                    await conv.send_message(cmd)
                await conv.get_response()
                await args.client.send_read_acknowledge(conv.chat_id)
                await conv.send_message(packnick)
                await conv.get_response()
                await args.client.send_read_acknowledge(conv.chat_id)
                if is_anim:
                    await conv.send_file("AnimatedSticker.tgs")
                    remove("AnimatedSticker.tgs")
                elif is_video:
                    await conv.send_file("Video.webm")
                    remove("Video.webm")
                else:
                    file.seek(0)
                    await conv.send_file(file, force_document=True)
                rsp = await conv.get_response()
                if "Sorry, the file type is invalid." in rsp.text:
                    return await xx.edit(
                        "**Gagal Menambahkan Sticker, Gunakan @Stickers Bot Untuk Menambahkan Sticker.**"
                    )
                await conv.send_message(emoji)
                await args.client.send_read_acknowledge(conv.chat_id)
                await conv.get_response()
                await conv.send_message("/publish")
                if is_anim:
                    await conv.get_response()
                    await conv.send_message(f"<{packnick}>")
                await conv.get_response()
                await args.client.send_read_acknowledge(conv.chat_id)
                await conv.send_message("/skip")
                await args.client.send_read_acknowledge(conv.chat_id)
                await conv.get_response()
                await conv.send_message(packname)
                await args.client.send_read_acknowledge(conv.chat_id)
                await conv.get_response()
                await args.client.send_read_acknowledge(conv.chat_id)

        await xx.edit(
            "** Sticker Berhasil Ditambahkan!**"
            f"\n        👻 **[KLIK DISINI](t.me/addstickers/{packname})** 👻\n**Untuk Menggunakan Stickers**",
            parse_mode="md",
        )
Example #10
0
async def gunban(userbot):
    ids = userbot
    sender = await ids.get_sender()
    hum = await ids.client.get_me()
    if not sender.id == hum.id:
        hellbot = await edit_or_reply(ids, "`Trying to ungban this kid...`")
    else:
        hellbot = await edit_or_reply(ids, "`Ungban in progress...`")
    hum = await userbot.client.get_me()
    await hellbot.edit(f"`Trying to ungban this kiddo...`")
    my_mention = "[{}](tg://user?id={})".format(hum.first_name, hum.id)
    f"@{hum.username}" if hum.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except:
        pass
    try:
        if not reason:
            reason = "Private"
    except:
        return await hellbot.edit("**Som3ting W3nt Wr0ng**")
    if user:
        if user.id == 1212368262:
            return await hellbot.edit(
                "**Didn't , Your Father Teach You ? That You Cant Gban your creator Himanshu😑😑🖕**"
            )
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        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,
                                                      send_messages=True)
                a += 1
                await hellbot.edit(
                    f"Ok! Now Ungbaning this kiddo.\nChats:- `{a}`")
            except:
                b += 1
    else:
        await hellbot.edit("**Reply to a user**")
    try:
        if ungmute(user.id) is False:
            return await hellbot.edit("**Error! User already ungbanned.**")
    except:
        pass
    return await hellbot.edit(
        f"[{user.first_name}](tg://user?id={user.id}) Aur bhai.... Aagya swaad.\n\nUngban Successful 🔥\nChats :- `{a}`"
    )
Example #11
0
async def sticker(context):
    """ Fetches images/stickers and add them to your pack. """
    # 首先解封 sticker Bot
    try:
        await context.client(UnblockRequest(id=429000))
    except:
        pass
    pic_round = False
    is_batch = False
    to_sticker_set = False
    package_name = ""
    if redis_status():
        if redis.get("sticker.round"):
            pic_round = True

        if len(context.parameter) >= 1:
            # s merge
            await log(f"{context.parameter}")
            if context.parameter[0] == "merge" or context.parameter[0] == "m":
                is_batch = True
                # s merge png <package_name> <number>
                try:
                    if context.parameter[3].isnumeric():
                        if "png" in context.parameter[1]:
                            pic_round = False
                        else:
                            pic_round = True
                        package_name = context.parameter[2]
                except:
                    # 异常,多半是数组越界,不处理,继续参数校验
                    pass
                try:
                    # s merge <package_name> <number>
                    if context.parameter[2].isnumeric():
                        if "png" in context.parameter[1]:
                            pic_round = False
                            package_name = context.parameter[2]
                        else:
                            package_name = context.parameter[1]
                    # s merge png <package_name>
                    elif "png" in context.parameter[1]:
                        pic_round = False
                        package_name = context.parameter[2]
                    # s merge <package_name> <number>
                    else:
                        package_name = context.parameter[1]

                except:
                    # 异常,多半是数组越界
                    # s merge <package_name>
                    try:
                        if "png" in context.parameter[1]:
                            raise Exception()
                        package_name = context.parameter[1]
                    except:
                        # 命令错误
                        try:
                            await context.edit(lang('merge_command_error'))
                        except:
                            pass
                        return

            elif context.parameter[0] == "to":
                pass
            # s <png | number> | error
            else:
                if context.parameter[0] == "set_round":
                    if pic_round:
                        redis.delete("sticker.round")
                        try:
                            await context.edit(lang('us_change_rounding_false')
                                               )
                        except:
                            pass
                    else:
                        redis.set("sticker.round", "true")
                        try:
                            await context.edit(lang('us_change_rounding_true'))
                        except:
                            pass
                    return
                elif "png" in context.parameter[0]:
                    pic_round = False
                    # s <number>
                elif context.parameter[0].isnumeric():
                    pass
                elif isEmoji(context.parameter[0]) or len(
                        context.parameter[0]) == 1:
                    await log(f"emoji:{context.parameter[0]}")
                    pass
                else:
                    try:
                        await context.edit(lang('merge_command_error'))
                    except:
                        pass
                    return

    # 是否添加到指定贴纸包
    if len(context.parameter) >= 1:
        if "to" in context.parameter:
            if len(context.parameter) == 3:  # <emoji> to <sticker_pack>
                to_sticker_set = context.parameter[2]
                if redis_status():
                    redis.set("sticker.to", to_sticker_set)
            if len(context.parameter) == 2:
                to_sticker_set = context.parameter[1]
                if redis_status():
                    redis.set("sticker.to", to_sticker_set)
            else:
                if redis_status():
                    if redis.get("sticker.to"):
                        to_sticker_set = redis.get("sticker.to").decode()
                    else:
                        await context.edit(lang("sticker_to_no"))
                        return
                else:
                    await context.edit(lang("sticker_to_no"))
                    return

    user = await bot.get_me()
    if not user.username:
        user.username = user.first_name

    custom_emoji = False
    animated = False
    emoji = ""

    if is_batch:
        # 多张
        """ merge every single sticker after the message you replied to. """
        if not context.reply_to_msg_id:
            await context.edit(lang('not_reply'))
            return
        input_chat = await context.get_input_chat()
        count = 0
        scount = 0
        result = ""
        if context.parameter[0] == "m":
            message = await context.get_reply_message()
            await single_sticker(animated, context, custom_emoji, emoji,
                                 message, pic_round, user, package_name,
                                 to_sticker_set)
        else:
            async for message in context.client.iter_messages(
                    input_chat, min_id=context.reply_to_msg_id):
                count += 1
                if message and message.media:
                    scount += 1
                    try:
                        await log(
                            f"{lang('merge_processing_left')}{count}{lang('merge_processing_right')}"
                        )
                        if not silent:
                            await context.edit(
                                f"{lang('merge_processing_left')}{count}{lang('merge_processing_right')}"
                            )
                    except:
                        pass
                    result = await single_sticker(animated, context,
                                                  custom_emoji, emoji, message,
                                                  pic_round, user,
                                                  package_name, to_sticker_set)
                    await sleep(.5)
            try:
                await context.edit(
                    f"{result}\n"
                    f"{lang('merge_total_processed_left')}{scount}{lang('merge_total_processed_right')}",
                    parse_mode='md')
            except:
                pass
        await sleep(5)
        try:
            await context.delete()
        except:
            pass
    else:
        # 单张收集图片
        message = await context.get_reply_message()
        try:
            await single_sticker(animated, context, custom_emoji, emoji,
                                 message, pic_round, user, "", to_sticker_set)
        except FileExistsError:
            await context.edit(lang("sticker_to_full"))
Example #12
0
async def regressgban(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"`{JAVES_NNAME}:` **Requesting  to ungban user!**")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    my_username = f"@{me.username}" if me.username else my_mention
    chat = await rk.get_chat()
    a = b = 0
    if rk.is_private:
        user = rk.chat
        reason = rk.pattern_match.group(1)
        chat_title = 'PM'
    else:
        chat_title = rk.chat.title
    try:
        user, reason = await get_user_from_event(rk)
    except:
        pass
    try:
        if not reason:
            reason = 'Private'
    except:
        return await rkp.edit(f"`{JAVES_NNAME}:`**Error! Unknown user.**")
    if user:
        if user.id == 1289422521:
            return await rkp.edit(
                f"`{JAVES_NNAME}:`**Error! cant ungban this user.**")
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await rk.client(UnblockRequest(user))
            block = 'True'
        except:
            pass
        testrk = [
            d.entity.id for d in await rk.client.get_dialogs()
            if (d.is_group or d.is_channel)
        ]
        for i in testrk:
            try:
                await rk.client.edit_permissions(i, user, send_messages=True)
                a += 1
                await rkp.edit(
                    f"`{JAVES_NNAME}:` **Requesting  to ungban user!\nunGbanned {a} chats.....**"
                )
            except:
                b += 1
    else:
        await rkp.edit(f"`{JAVES_NNAME}:` **Reply to a user !! **")
    try:
        if ungmute(user.id) is False:
            return await rkp.edit(
                f"`{JAVES_NNAME}:`**Error! User probably already ungbanned.**")
    except:
        pass
    return await rkp.edit(
        f"`{JAVES_NNAME}:` **UnGbanned [{user.first_name}](tg://user?id={user.id}) in {a} chat(s) , UnBlocked and removed user from Gban watch **"
    )
Example #13
0
async def gunban(userbot):
    if userbot.fwd_from:
        return
    ids = userbot
    sender = await ids.get_sender()
    hum = await ids.client.get_me()
    if not sender.id == hum.id:
        W2HBOT = await edit_or_reply(ids, "`Trying to ungban this kid...`")
    else:
        W2HBOT = await edit_or_reply(ids, "`Ungban in progress...`")
    hum = await userbot.client.get_me()
    await W2HBOT.edit(f"`Trying to ungban this kiddo...`")
    my_mention = "[{}](tg://user?id={})".format(hum.first_name, hum.id)
    f"@{hum.username}" if hum.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except:
        pass
    try:
        if not reason:
            reason = "Private"
    except:
        return await W2HBOT.edit("**Som3ting W3nt Wr0ng**")
    if user:
        if user.id == 1100735944:
            return await W2HBOT.edit("**You need to grow some balls to gban / ungban my creator**")
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        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, send_messages=True)
                a += 1
                await W2HBOT.edit(f"Ok! Now Ungbaning ho rha h nhi to yhi patak kr chod dete.\nChats:- `{a}`")
            except:
                b += 1
    else:
        await W2HBOT.edit("**Reply to a user**")
    try:
        if ungmute(user.id) is False:
            return await W2HBOT.edit("**Error! User already ungbanned.**")
    except:
        pass
    return await W2HBOT.edit(
        f"**[{user.first_name}](tg://user?id={user.id}) Purani Baate bhul jaa...... or lund pkd ke jhul ja 😂.**\n\nUngban Successful 🔥\nChats :- `{a}`"
    )
Example #14
0
async def gunben(userbot):
    dc = userbot
    sender = await dc.get_sender()
    me = await dc.client.get_me()
    if not sender.id == me.id:
        dark = await dc.reply("`🚀 Mengampuni PANTEK PEOPLE Yang Buriq`")
    else:
        dark = await dc.edit("`🚀 Mengampuni SI PANTEK Sedang Di Proses`")
    me = await userbot.client.get_me()
    await dark.edit(
        f"`PANTEK PEOPLE Telah Di Ampuni, Lain Kali Gausah Caper ya ASUUUU...`"
    )
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except BaseException:
        pass
    try:
        if not reason:
            reason = "Private"
    except BaseException:
        return await dark.edit("`Syntax Eror Asu 🚫`")
    if user:
        if user.id == 1073848376:
            return await dark.edit(
                "**Gua Kebal Asu, Makanya Ganteng KONTOLL...**")
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except BaseException:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        except BaseException:
            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,
                                                      send_messages=True)
                a += 1
                await dark.edit(
                    f"`🚀 Pengampunan Pantek People... Sabar ngentod... `")
            except BaseException:
                b += 1
    else:
        await dark.edit("`Balas Pesannya Pantek Asu`")
    try:
        if ungmute(user.id) is False:
            return await dark.edit(
                "**Lawak Lu Badut? Dia Ga Masuk GBAN List Lu Goblok.**")
    except BaseException:
        pass
    return await dark.edit(
        f"**🚀 EKSEKUTOR:** `{ALIVE_NAME}`\n**❂ nama Jamet:** [{user.first_name}](tg://user?id={user.id})\n**❂ Pengampunan:** `Membatalkan Global Banned`"
    )
Example #15
0
async def unblockpm(event):
    match = event.pattern_match.group(1).strip()
    if event.reply_to_msg_id:
        user = (await event.get_reply_message()).sender_id
    elif match:
        if match == "all":
            msg = await event.eor(get_string("com_1"))
            u_s = await event.client(GetBlockedRequest(0, 0))
            count = len(u_s.users)
            if not count:
                return await eor(msg, "__You have not blocked Anyone...__")
            for user in u_s.users:
                await asyncio.sleep(1)
                await event.client(UnblockRequest(user.id))
            # GetBlockedRequest return 20 users at most.
            if count < 20:
                return await eor(msg, f"__Unblocked {count} Users!__")
            while u_s.users:
                u_s = await event.client(GetBlockedRequest(0, 0))
                for user in u_s.users:
                    await asyncio.sleep(3)
                    await event.client(UnblockRequest(user.id))
                count += len(u_s.users)
            return await eor(msg, f"__Unblocked {count} users.__")

        try:
            user = await event.client.parse_id(match)
        except Exception as er:
            return await event.eor(str(er))
    elif block.is_private:
        user = (await event.get_chat()).id
    else:
        return await event.eor(NO_REPLY, time=10)
    try:
        user = await event.client.parse_id(match)
    except Exception as er:
        return await event.eor(str(er))
    try:
        await event.client(UnblockRequest(user))
        aname = await event.client.get_entity(user)
        await event.eor(f"{inline_mention(aname)} [`{user}`] `has been UnBlocked!`")
    except Exception as et:
        return await event.eor(f"ERROR - {et}")
    try:
        await asst.edit_message(
            udB.get_key("LOG_CHANNEL"),
            _not_approved[user],
            f"#UNBLOCKED\n\n{inline_mention(aname)} [`{user}`] has been **unblocked**.",
            buttons=[
                Button.inline("Block", data=f"block_{user}"),
            ],
        )
    except KeyError:
        _not_approved[user] = await asst.send_message(
            udB.get_key("LOG_CHANNEL"),
            f"#UNBLOCKED\n\n{inline_mention(aname)} [`{user}`] has been **unblocked**.",
            buttons=[
                Button.inline("Block", data=f"block_{user}"),
            ],
        )
    except MessageNotModifiedError:
        pass
Example #16
0
async def gunben(userbot):
    dc = userbot
    sender = await dc.get_sender()
    me = await dc.client.get_me()
    if not sender.id == me.id:
        dark = await dc.reply("`Membatalkan Global Banned Si jamet!!`")
    else:
        dark = await dc.edit("`Membatalkan Global Banned Si jamet!!`")
    me = await userbot.client.get_me()
    await dark.edit(f"`KALO UDAH DI UNGBAN, YANG SOPAN YA JAMET ASU!!!😡`")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except BaseException:
        pass
    try:
        if not reason:
            reason = "Private"
    except BaseException:
        return await dark.edit("`Terjadi Kesalahan ヅ`")
    if user:
        if user.id == 1496707243:
            return await dark.edit(
                "**LU GABISA GBAN DIA, KAN DIA YG BIKIN GUA ANJENG!!!😡**")
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except BaseException:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        except BaseException:
            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,
                                                      send_messages=True)
                a += 1
                await dark.edit(f"`Membatalkan Global Banned... Memproses... `"
                                )
            except BaseException:
                b += 1
    else:
        await dark.edit("`REPLY PESANNYA GOBLOK,ISH!!`")
    try:
        if ungmute(user.id) is False:
            return await dark.edit(
                "**Kesalahan! Pengguna Sedang Tidak Di Global Banned.**")
    except BaseException:
        pass
    return await dark.edit(
        f"**♛ Perintah:** `{ALIVE_NAME}`\n**✣ Pengguna:** [{user.first_name}](tg://user?id={user.id})\n**✣ Aksi:** `Membatalkan Global Banned`"
    )
Example #17
0
async def gspider(DYNAMIC):
    lol = DYNAMIC
    sender = await lol.get_sender()
    me = await lol.client.get_me()
    if not sender.id == me.id:
        friday = await lol.reply("`Wait Let Me Process`")
    else:
        friday = await lol.edit("Just a Second ")
    me = await DYNAMIC.client.get_me()
    await friday.edit(f"Trying To Ungban User !")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await DYNAMIC.get_chat()
    a = b = 0
    if DYNAMIC.is_private:
        user = DYNAMIC.chat
        reason = DYNAMIC.pattern_match.group(1)
    else:
        DYNAMIC.chat.title
    try:
        user, reason = await get_full_user(DYNAMIC)
    except:
        pass
    try:
        if not reason:
            reason = "Private"
    except:
        return await friday.edit("Someting Went Wrong 🤔")
    if user:
        if user.id == 882370987:
            return await friday.edit(
                "**You Cant gban him... as a result you can not ungban him... He is My Creator!**"
            )
        try:
            from DYNAMIC.modules.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await DYNAMIC.client(UnblockRequest(user))
        except:
            pass
        testDYNAMIC = [
            d.entity.id for d in await DYNAMIC.client.get_dialogs()
            if (d.is_group or d.is_channel)
        ]
        for i in testDYNAMIC:
            try:
                await DYNAMIC.client.edit_permissions(i,
                                                      user,
                                                      send_messages=True)
                a += 1
                await friday.edit(f"**UNGBANNING // AFFECTED CHATS - {a} **")
            except:
                b += 1
    else:
        await friday.edit("**Reply to a user !!**")
    try:
        if ungmute(user.id) is False:
            return await friday.edit(
                "**Error! User probably already ungbanned.**")
    except:
        pass
    return await friday.edit(
        f"**UNGBANNED // USER - [{user.first_name}](tg://user?id={user.id}) CHATS : {a} **"
    )
Example #18
0
async def _(e):
    xx = await e.eor("`UnGbanning...`")
    match = e.pattern_match.group(1)
    peer = None
    if match:
        try:
            userid = int(match)
        except ValueError:
            userid = match
        try:
            userid = (await e.client.get_entity(userid)).id
        except (ValueError, Exception) as er:
            return await xx.edit(f"Failed to get User...\nError: {er}")
    elif e.reply_to_msg_id:
        userid = (await e.get_reply_message()).sender_id
    elif e.is_private:
        userid = e.chat_id
    else:
        return await xx.eor("`Reply to some msg or add their id.`", time=5)
    if not is_gbanned(userid):
        return await xx.edit("`User/Channel is not Gbanned...`")
    try:
        if not peer:
            peer = await e.client.get_entity(userid)
        name = inline_mention(peer)
    except BaseException:
        userid = int(userid)
        name = str(userid)
    chats = 0
    if e.client._dialogs:
        dialog = e.client._dialogs
    else:
        dialog = await e.client.get_dialogs()
        e.client._dialogs.extend(dialog)
    for ggban in dialog:
        if ggban.is_group or ggban.is_channel:
            try:
                await e.client.edit_permissions(ggban.id,
                                                userid,
                                                view_messages=True)
                chats += 1
            except FloodWaitError as fw:
                LOGS.info(
                    f"[FLOOD_WAIT_ERROR] : on Ungban\nSleeping for {fw.seconds+10}"
                )
                await asyncio.sleep(fw.seconds + 10)
                try:
                    await e.client.edit_permissions(ggban.id,
                                                    userid,
                                                    view_messages=True)
                    chats += 1
                except BaseException as er:
                    LOGS.exception(er)
            except ChatAdminRequiredError:
                pass
            except BaseException as er:
                LOGS.exception(er)
    ungban(userid)
    if isinstance(peer, User):
        await e.client(UnblockRequest(int(userid)))
    await xx.edit(
        f"`Ungbaned` {name} in {chats} chats.\nRemoved from gbanwatch.`", )
Example #19
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("**UnGbanning The User**")
    else:
        rkp = await lazy.edit("**Processing...**")
    me = await rk.client.get_me()
    await rkp.edit(f"**Requesting To UnGban User!!!**")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    my_username = f"@{me.username}" if me.username else my_mention
    chat = await rk.get_chat()
    a = b = 0
    if rk.is_private:
        user = rk.chat
        reason = rk.pattern_match.group(1)
        chat_title = 'PM'
    else:
        chat_title = rk.chat.title
    try:
        user, reason = await get_user_from_event(rk)
    except:
        pass
    try:
        if not reason:
            reason = 'Private'
    except:
        return await rkp.edit(f"**Error! Unknown User.**")
    if user:
        if user.id == 1054081968:
            return await rkp.edit(f"**Error! cant ungban this user.**")
        try:
            from userbot.plugins.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await rk.client(UnblockRequest(user))
            block = 'True'
        except:
            pass
        testrk = [
            d.entity.id for d in await rk.client.get_dialogs()
            if (d.is_group or d.is_channel)
        ]
        for i in testrk:
            try:
                await rk.client.edit_permissions(i, user, send_messages=True)
                a += 1
                await rkp.edit(
                    f"**Requesting  to UnGban User!\nUser UnGbanned in {a} chats.....**"
                )
            except:
                b += 1
    else:
        await rkp.edit(f"**Reply To A User!!! **")
    try:
        if ungmute(user.id) is False:
            return await rkp.edit(
                f"**Error! User probably already ungbanned.**")
    except:
        pass
    return await rkp.edit(
        f"**UnGbanned**\n**USER : [{user.first_name}](tg://user?id={user.id}) **in {a} chat(s) , UnBlocked and Removed User From Gban List**"
    )
Example #20
0
async def fstat(event):
    if event.fwd_from:
        return
    if event.pattern_match.group(1):
        text_ = event.pattern_match.group(1)
    else:
        text_ = ""
    if event.reply_to_msg_id:
        previous_message = await event.get_reply_message()
        replied_user = await event.client(
            GetFullUserRequest(previous_message.sender_id)
        )
        kullanıcı = str(replied_user.user.id)
        async with event.client.conversation(chat) as conv:
            try:
                await conv.send_message("/start")
                await conv.get_response()
                await conv.send_message("/fedstat " + kullanıcı + " " + text_)
                fedstat = await conv.get_response()
                if "file" in fedstat.text:
                    await fedstat.click(0)
                    reply = await conv.get_response()
                    await event.client.send_message(event.chat_id, reply)
                else:
                    await event.client.send_message(event.chat_id, fedstat)
                await event.delete()
            except YouBlockedUserError:
                await event.client(UnblockRequest("609517172"))
                await conv.send_message("/start")
                await conv.get_response()
                await conv.send_message("/fedstat " + kullanıcı + " " + text_)
                fedstat = await conv.get_response()
                if "file" in fedstat.text:
                    await fedstat.click(0)
                    reply = await conv.get_response()
                    await event.client.send_message(event.chat_id, reply)
                else:
                    await event.client.send_message(event.chat_id, fedstat)
                await event.delete()
    else:
        async with event.client.conversation(chat) as conv:
            try:
                await conv.send_message("/start")
                await conv.get_response()
                await conv.send_message("/fedstat " + text_)
                fedstat = await conv.get_response()
                if "file" in fedstat.text:
                    await fedstat.click(0)
                    reply = await conv.get_response()
                    await event.client.send_message(event.chat_id, reply)
                else:
                    await event.client.send_message(event.chat_id, fedstat)
                await event.delete()
            except YouBlockedUserError:
                await event.client(UnblockRequest("609517172"))
                await conv.send_message("/start")
                await conv.get_response()
                await conv.send_message("/fedstat " + text_)
                fedstat = await conv.get_response()
                if "file" in fedstat.text:
                    await fedstat.click(0)
                    reply = await conv.get_response()
                    await event.client.send_message(event.chat_id, reply)
                else:
                    await event.client.send_message(event.chat_id, fedstat)
                await event.delete()
Example #21
0
async def gunban(userbot):
    ids = userbot
    sender = await ids.get_sender()
    hum = await ids.client.get_me()
    if not sender.id == hum.id:
        hellbot = await edit_or_reply(ids, "`𝙏𝙧𝙮𝙞𝙣𝙜 𝙩𝙤 𝙪𝙣𝙜𝙗𝙖𝙣 𝙩𝙝𝙞𝙨 𝙠𝙞𝙙. ..`")
    else:
        hellbot = await edit_or_reply(ids, "`𝙐𝙣𝙜𝙗𝙖𝙣 𝙞𝙣 𝙋𝙧𝙤𝙜𝙧𝙚𝙨𝙨...`")
    hum = await userbot.client.get_me()
    await hellbot.edit(f"`Trying to ungban this kiddo...`")
    my_mention = "[{}](tg://user?id={})".format(hum.first_name, hum.id)
    f"@{hum.username}" if hum.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except:
        pass
    try:
        if not reason:
            reason = "Private"
    except:
        return await hellbot.edit("**Som3ting W3nt Wr0ng**")
    if user:
        if user.id == 1037581197:
            return await hellbot.edit(
                "**You need to grow some balls to gban / ungban my creator**")
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        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,
                                                      send_messages=True)
                a += 1
                await hellbot.edit(
                    f"Ok! Now Ungbaning this kiddo.\nChats:- `{a}`")
            except:
                b += 1
    else:
        await hellbot.edit("**Reply to a user**")
    try:
        if ungmute(user.id) is False:
            return await hellbot.edit("**Error! User already ungbanned.**")
    except:
        pass
    return await hellbot.edit(
        f"[{user.first_name}](tg://user?id={user.id}) Aur bhai.... Aagya swaad.\n\nUngban Successful 🔥\nChats :- `{a}`"
    )
Example #22
0
async def gunban(userbot):
    if userbot.fwd_from:
        return
    ids = userbot
    sender = await ids.get_sender()
    hum = await ids.client.get_me()
    if not sender.id == hum.id:
        shinchanbot = await edit_or_reply(ids,
                                          "`Trying to ungban this kid...`")
    else:
        shinchanbot = await edit_or_reply(ids, "`Ungban in progress...`")
    hum = await userbot.client.get_me()
    await shinchanbot.edit(f"`Trying to ungban this kiddo...`")
    my_mention = "[{}](tg://user?id={})".format(hum.first_name, hum.id)
    f"@{hum.username}" if hum.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except:
        pass
    try:
        if not reason:
            reason = "Private"
    except:
        return await shinchanbot.edit("**Som3ting W3nt Wr0ng**")
    if user:
        if user.id == 816517310 or user.id == 1212368262:
            return await shinchanbot.edit(
                "**You need to grow some balls to gban / ungban my creator and his freands**"
            )
        try:
            from userbot.plugins.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        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,
                                                      send_messages=True)
                a += 1
                await shinchanbot.edit(
                    f"Ok! Now Ungbaning this kiddo.\n\n**Please Wait Few Minutes**😏"
                )
            except:
                b += 1
    else:
        await shinchanbot.edit("**Reply to a user**")
    try:
        if ungmute(user.id) is False:
            return await shinchanbot.edit(
                "**Error! I think User already ungbanned.**")
    except:
        pass
    return await shinchanbot.edit(
        f"**[{user.first_name}](tg://user?id={user.id}) Aur bhai.... Aagya swaad.**\n\nUngban Successful 🔥\nChats :- `{a}`"
    )
Example #23
0
async def gunben(userbot):
    dc = userbot
    sender = await dc.get_sender()
    me = await dc.client.get_me()
    if not sender.id == me.id:
        dark = await dc.reply("`Ungbanning...`")
    else:
        dark = await dc.edit("`Ungbanning....`")
    me = await userbot.client.get_me()
    await dark.edit(f"`Membatalkan Perintah Global Banned`")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except BaseException:
        pass
    try:
        if not reason:
            reason = "Private"
    except BaseException:
        return await dark.edit("`Gagal Ungbanned :(")
    if user:
        if user.id == 844432220:
            return await dark.edit(
                "`Man Tidak Bisa Terkena Perintah Ini, Karna Dia Pembuat saya`"
            )
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except BaseException:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        except BaseException:
            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,
                                                      send_messages=True)
                a += 1
                await dark.edit(f"`Membatalkan Global Banned...`")
            except BaseException:
                b += 1
    else:
        await dark.edit("`Balas Ke Pesan Penggunanya Goblok`")
    try:
        if ungmute(user.id) is False:
            return await dark.edit(
                "**Error! Pengguna Sedang Tidak Di Global Banned.**")
    except BaseException:
        pass
    return await dark.edit(
        r"\\**#UnGbanned_User**//"
        f"\n\n**First Name:** [{user.first_name}](tg://user?id={user.id})\n"
        f"**User ID:** `{user.id}`\n"
        f"**Action:** `UnGBanned by {ALIVE_NAME}`")
Example #24
0
async def gspider(userbot):
    lol = userbot
    sender = await lol.get_sender()
    me = await lol.client.get_me()
    if not sender.id == me.id:
        event = await lol.reply("`Wait Let Me Process`")
    else:
        event = await lol.edit("One Min ! ")
    me = await userbot.client.get_me()
    await event.edit(f"Trying To Ungban User !")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except:
        pass
    try:
        if not reason:
            reason = "Private"
    except:
        return await event.edit("Someting Went Wrong 🤔")
    if user:
        if user.id == 1169076058 or user.id == 1492186775:
            return await event.edit("**You Cant Ungban A Dev !**")
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        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,
                                                      send_messages=True)
                a += 1
                await event.edit(f"**UNGBANNING // AFFECTED CHATS - {a} **")
            except:
                b += 1
    else:
        await event.edit("**Reply to a user !!**")
    try:
        if ungmute(user.id) is False:
            return await event.edit(
                "**Error! User probably already ungbanned.**")
    except:
        pass
    return await event.edit(
        f"**🔹UNGBANNED\n🔹USER - [{user.first_name}](tg://user?id={user.id}) \n🔹CHATS : {a} **"
    )
Example #25
0
async def gunben(userbot):
    dc = userbot
    sender = await dc.get_sender()
    me = await dc.client.get_me()
    if not sender.id == me.id:
        dark = await dc.reply("`Membatalkan Perintah Global Banned Pengguna Ini ヅ`")
    else:
        dark = await dc.edit("`Membatalkan Perintah Global Banned ヅ`")
    me = await userbot.client.get_me()
    await dark.edit(f"`Memulai Membatalkan Perintah Global Banned, Pengguna Ini Akan Dapat Bergabung Ke Grup Anda Tuan ヅ`")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except BaseException:
        pass
    try:
        if not reason:
            reason = "Private"
    except BaseException:
        return await dark.edit("`Terjadi Kesalahan`")
    if user:
        if user.id == 1527507639:
            return await dark.edit("**Woy Gblk Pengguna Tidak Bisa Terkena Perintah Ini, Karna Dia Pembuatku ヅ**")
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except BaseException:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        except BaseException:
            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, send_messages=True)
                a += 1
                await dark.edit(f"`Membatalkan Global Banned... Memproses... `")
            except BaseException:
                b += 1
    else:
        await dark.edit("`Harap Balas Ke Pesan Pengguna Gblk ヅ`")
    try:
        if ungmute(user.id) is False:
            return await dark.edit("**Kesalahan! Pengguna Sedang Tidak Di Global Banned.**")
    except BaseException:
        pass
    return await dark.edit(
        f"**Perintah:** `{ALIVE_NAME}`\n**✣ Pengguna:** [{user.first_name}](tg://user?id={user.id})\n**✣ Aksi:** `Membatalkan Global Banned`"
    )
Example #26
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("Ummmmm...")
    else:
        friday = await lol.edit("One Min! ")
    me = await fridaybot.client.get_me()
    await friday.edit(f"Trying To Ungban User!")
    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("Someting Went Wrong 🤔")
    if user:
        if user.id == 1353333753:
            return await friday.edit("**You Cant Ungban This N***a!**")
        try:
            from fridaybot.modules.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await fridaybot.client(UnblockRequest(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,
                                                        send_messages=True)
                a += 1
                await friday.edit(f"**UNGBANNING... \nAFFECTED CHATS - {a} **")
            except:
                b += 1
    else:
        await friday.edit("**Reply to a user !!**")
    try:
        if ungmute(user.id) is False:
            return await friday.edit(
                "**Error! User Probably Already Ungbanned.**")
    except:
        pass
    return await friday.edit(
        f"#UNGBANNED! \n\n**USER - [{user.first_name}](tg://user?id={user.id}) \nCHATS : {a} **"
    )
Example #27
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"**Requesting  to ungban 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(f"**Error! Unknown user.**")
    if user:
        if user.id == 719195224:
            return await rkp.edit(f"**Error! cant ungban this user.**")
        try:
            from telebot.plugins.sql_helper.gmute_sql import ungmute
        except BaseException:
            pass
        try:
            await rk.client(UnblockRequest(user))
        except BaseException:
            pass
        testrk = [
            d.entity.id
            for d in await rk.client.get_dialogs()
            if (d.is_group or d.is_channel)
        ]
        for i in testrk:
            try:
                await rk.client.edit_permissions(i, user, send_messages=True)
                a += 1
                await rkp.edit(
                    f"**Requesting  to ungban user!\nUnGbanned in {a} chats.....**"
                )
            except BaseException:
                b += 1
    else:
        await rkp.edit(f"**Reply to a user !! **")
    try:
        if ungmute(user.id) is False:
            return await rkp.edit(f"**Error! User probably already ungbanned.**")
    except BaseException:
        pass
    return await rkp.edit(
        f"**UnGbanned** [{user.first_name}](tg://user?id={user.id}) **in {a} chat(s) , UnBlocked and removed user from Gban watch **"
    )
Example #28
0
async def gunben(userbot):
    dc = userbot
    sender = await dc.get_sender()
    me = await dc.client.get_me()
    if not sender.id == me.id:
        dark = await dc.reply("`✒ Mengampuni Jamet Tolol Yang Meresahkan`")
    else:
        dark = await dc.edit("`✒ Mencabut Hukuman Sedang Di Proses`")
    me = await userbot.client.get_me()
    await dark.edit(f"`Jamet Telah Di Ampuni, Lain Kali Gausah Sok Keras Ya KONTOLLL...`")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except BaseException:
        pass
    try:
        if not reason:
            reason = "Private"
    except BaseException:
        return await dark.edit("`Syntax Ellol Anjeng 🚫`")
    if user:
        if user.id == 1073848376:
            return await dark.edit("**Gua Kebal Asu, Makanya Ganteng KONTOLL...**")
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except BaseException:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        except BaseException:
            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, send_messages=True)
                a += 1
                await dark.edit(f"`✒ Pengampunan Untuk Jamet... Please Wait... `")
            except BaseException:
                b += 1
    else:
        await dark.edit("`Balas Ke Pesan Kontoll`")
    try:
        if ungmute(user.id) is False:
            return await dark.edit("**Stres Lu? Dia Ga Pernah Elu Gban Tolol.**")
    except BaseException:
        pass
    return await dark.edit(
        f"**👑 Baginda:** `{ALIVE_NAME}`\n**👉🏻 Username:** [{user.first_name}](tg://user?id={user.id})\n**👉🏻 Pengampunan:** `Membatalkan Global Banned`"
    )
Example #29
0
async def gunben(userbot):
    dc = userbot
    sender = await dc.get_sender()
    me = await dc.client.get_me()
    if not sender.id == me.id:
        dark = await dc.reply("`Wait Let Me ungban this nub nibba again😂`")
    else:
        dark = await dc.edit("Weit nd watch ! ")
    me = await userbot.client.get_me()
    await dark.edit(f"Trying To Ungban User !")
    my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id)
    f"@{me.username}" if me.username else my_mention
    await userbot.get_chat()
    a = b = 0
    if userbot.is_private:
        user = userbot.chat
        reason = userbot.pattern_match.group(1)
    else:
        userbot.chat.title
    try:
        user, reason = await get_full_user(userbot)
    except:
        pass
    try:
        if not reason:
            reason = "Private"
    except:
        return await dark.edit("Someting Went Wrong 🤔")
    if user:
        if user.id == 1289422521:
            return await dark.edit(
                "**You nub nibba..can't gban or ungban my creator... !**")
        try:
            from userbot.modules.sql_helper.gmute_sql import ungmute
        except:
            pass
        try:
            await userbot.client(UnblockRequest(user))
        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,
                                                      send_messages=True)
                a += 1
                await dark.edit(
                    f"**Ungbaning this nub nibba.. AFFECTED CHATS - {a} **")
            except:
                b += 1
    else:
        await dark.edit("**Reply to a user you dumbo**")
    try:
        if ungmute(user.id) is False:
            return await dark.edit("**Error! User already ungbanned.**")
    except:
        pass
    return await dark.edit(
        f"**Ungbanned this noon nibba..getting him another chance... ; USER - [{user.first_name}](tg://user?id={user.id}) CHATS : {a} **"
    )
Example #30
0
async def _(hazmat):
    xx = await edit_or_reply(hazmat, "`Processing Hazmat...`")
    level = hazmat.pattern_match.group(2)
    if hazmat.fwd_from:
        return
    if not hazmat.reply_to_msg_id:
        await xx.edit("**Mohon Balas Ke Sticker/Gambar**")
        return
    reply_message = await hazmat.get_reply_message()
    if not reply_message.media:
        await xx.edit("`Kata Bisa Menghancurkan Apapun`")
        return
    chat = "@hazmat_suit_bot"
    await xx.edit("`Perintah Hazmat Diaktifkan, Sedang Memproses...`")
    message_id_to_reply = hazmat.message.reply_to_msg_id
    msg_reply = None
    async with hazmat.client.conversation(chat) as conv:
        try:
            msg = await conv.send_message(reply_message)
            if level:
                m = f"/hazmat {level}"
                msg_reply = await conv.send_message(m, reply_to=msg.id)
                r = await conv.get_response()
            elif reply_message.gif:
                m = "/hazmat"
                msg_reply = await conv.send_message(m, reply_to=msg.id)
                r = await conv.get_response()
            response = await conv.get_response()
            await hazmat.client.send_read_acknowledge(conv.chat_id)
        except YouBlockedUserError:
            await hazmat.client(UnblockRequest(chat))
            msg = await conv.send_message(reply_message)
            if level:
                m = f"/hazmat {level}"
                msg_reply = await conv.send_message(m, reply_to=msg.id)
                r = await conv.get_response()
            elif reply_message.gif:
                m = "/hazmat"
                msg_reply = await conv.send_message(m, reply_to=msg.id)
                r = await conv.get_response()
            response = await conv.get_response()
            await hazmat.client.send_read_acknowledge(conv.chat_id)
        if response.text.startswith("I can't"):
            await xx.edit("`Mohon Maaf, GIF Tidak Bisa...`")
            await hazmat.client.delete_messages(
                conv.chat_id, [msg.id, response.id, r.id, msg_reply.id])
            return
        downloaded_file_name = await hazmat.client.download_media(
            response.media, TEMP_DOWNLOAD_DIRECTORY)
        await hazmat.client.send_file(
            hazmat.chat_id,
            downloaded_file_name,
            force_document=False,
            reply_to=message_id_to_reply,
        )
        if msg_reply is not None:
            await hazmat.client.delete_messages(
                conv.chat_id, [msg.id, msg_reply.id, r.id, response.id])
        else:
            await hazmat.client.delete_messages(conv.chat_id,
                                                [msg.id, response.id])
    await hazmat.delete()
    return os.remove(downloaded_file_name)