Ejemplo n.º 1
0
async def unblockpm(unblock):
    """ .unblock komutu insanların size yeniden PM atabilmelerini sağlar. """
    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("`Engelin kaldırıldı.`")

    if BOTLOG:
        await unblock.client.send_message(
            BOTLOG_CHATID,
            f"[{name0}](tg://user?id={replied_user.id})"
            " kişisinin engeli kaldırıldı.",
        )
Ejemplo n.º 2
0
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.sender_id)
        name0 = str(replied_user.first_name)
        await unblock.client(UnblockRequest(replied_user.id))
        await unblock.edit("`You have been unblocked.`")

    if BOTLOG:
        await unblock.client.send_message(
            BOTLOG_CHATID,
            f"[{name0}](tg://user?id={replied_user.id})"
            " was unblocc'd!.",
        )
Ejemplo n.º 3
0
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("`Anda Sudah Tidak Diblokir Lagi.`")

    if BOTLOG:
        await unblock.client.send_message(
            BOTLOG_CHATID,
            f"[{name0}](tg://user?id={replied_user.id})"
            " Tidak Lagi Diblokir.",
        )
Ejemplo n.º 4
0
async def unblockpm(unblock):
    """ Para o comando .unblock, deixe as pessoas enviarem PMs para você novamente! """
    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("`Você foi desbloqueado!`")

    if BOTLOG:
        await unblock.client.send_message(
            BOTLOG_CHATID,
            f"[{name0}](tg://user?id={replied_user.id})"
            " foi desbloqueado!.",
        )
Ejemplo n.º 5
0
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(GetFullUserRequest(reply.from_id))
        name0 = str(replied_user.user.first_name)
        await unblock.edit("`Unblocked.`")
        await unblock.client(UnblockRequest(replied_user.user.id))

    if BOTLOG:
        await unblock.client.send_message(
            LOG,
            f"[{name0}](tg://user?id={replied_user.user.id})"
            " was unblocc'd!.",
        )
Ejemplo n.º 6
0
async def _(event):
    xx = await edit_or_reply(event, "`Processing...`")
    async with event.client.conversation("@SpamBot") as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=178220800))
            await conv.send_message("/start")
            response = await response
            await event.client.send_read_acknowledge(conv.chat_id)
        except YouBlockedUserError:
            await event.client(UnblockRequest("@SpamBot"))
            await conv.send_message("/start")
            response = await response
            await event.client.send_read_acknowledge(conv.chat_id)
        await xx.edit(f"~ {response.message.message}")
Ejemplo n.º 7
0
async def unblockpm(unblock):
    """ .unblock """
    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(f"`{LANG['UNBLOCKED']}`")

    if BOTLOG:
        await unblock.client.send_message(
            BOTLOG_CHATID,
            f"[{name0}](tg://user?id={replied_user.id})"
            " istifadəçisi blokdan çıxarıldı.",
        )
Ejemplo n.º 8
0
async def _(event):
    if event.fwd_from:
        return
    ManUBOT = await tgbot.get_me()
    BOT_USERNAME = ManUBOT.username
    if BOT_USERNAME is not None:
        chat = "@Botfather"
        try:
            results = await event.client.inline_query(BOT_USERNAME, "@SharingUserbot")
            await results[0].click(
                event.chat_id, reply_to=event.reply_to_msg_id, hide_via=True
            )
            await event.delete()
        except noinline:
            xx = await edit_or_reply(
                event,
                "**Inline Mode Tidak aktif.**\n__Sedang Menyalakannya, Harap Tunggu Sebentar...__",
            )
            async with bot.conversation(chat) as conv:
                try:
                    first = await conv.send_message("/setinline")
                    second = await conv.get_response()
                    third = await conv.send_message(BOT_USERNAME)
                    fourth = await conv.get_response()
                    fifth = await conv.send_message("Search")
                    sixth = await conv.get_response()
                    await bot.send_read_acknowledge(conv.chat_id)
                except YouBlockedUserError:
                    await event.client(UnblockRequest(chat))
                    first = await conv.send_message("/setinline")
                    second = await conv.get_response()
                    third = await conv.send_message(BOT_USERNAME)
                    fourth = await conv.get_response()
                    fifth = await conv.send_message("Search")
                    sixth = await conv.get_response()
                    await bot.send_read_acknowledge(conv.chat_id)
                await xx.edit(
                    f"**Berhasil Menyalakan Mode Inline**\n\n**Ketik** `{cmd}helpme` **lagi untuk membuka menu bantuan.**"
                )
            await bot.delete_messages(
                conv.chat_id,
                [first.id, second.id, third.id, fourth.id, fifth.id, sixth.id],
            )
    else:
        await edit_or_reply(
            event,
            "**Silahkan Buat BOT di @BotFather dan Tambahkan Var** `BOT_TOKEN` & `BOT_USERNAME`",
        )
Ejemplo n.º 9
0
async def regressgban(tb):
   oof = tb ; sender = await oof.get_sender() ; me = await oof.client.get_me()
   if not sender.id == me.id:
        tele = await oof.reply("`Processing...`")
   else:
    	tele = await oof.edit("`processing...`")   
   me = await tb.client.get_me() ; await tele.edit(f"`{ALIVE_NAME}:` **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 tb.get_chat() ; a = b = 0
   if tb.is_private:       
   	user = tb.chat ; reason = tb.pattern_match.group(1) ; chat_title = 'PM'  
   else:
   	chat_title = tb.chat.title  
   try:       
    user, reason = await get_user_from_event(tb)  
   except:
      pass
   try:
     if not reason:
       reason = 'Private'
   except:
   	return await tele.edit(f"`{ALIVE_NAME}:`**Error! Unknown user.**")
   if user:      
        if user.id == 709723121:     
    	             return await tele.edit(f"`{ALIVE_NAME}:`**Error! cant ungban this user.**")
        try:
          from userbot.modules.sql_helper.gmute_sql import ungmute
        except:
   	     pass
        try:
          await tb.client(UnblockRequest(user))
          block = 'True'
        except:      
           pass
        testtb = [d.entity.id for d in await tb.client.get_dialogs() if (d.is_group or d.is_channel) ]                          
        for i in testtb:
            try:
                 await tb.client.edit_permissions(i, user, send_messages=True)          
                 a += 1
                 await tele.edit(f"`{ALIVE_NAME}:` **Requesting  to ungban user!\nunGbanned {a} chats.....**")
            except:
                 b += 1                     
   else:
       await tele.edit(f"`{ALIVE_NAME}:` **Reply to a user !! **")        
   try:
     if ungmute(user.id) is False:
            return await tele.edit(f"`{ALIVE_NAME}:`**Error! User probably already ungbanned.**")
   except:
    	pass
   return await tele.edit(f"`{ALIVE_NAME}:` **UnGbanned [{user.first_name}](tg://user?id={user.id}) in {a} chat(s) , UnBlocked and removed user from Gban watch **") 
Ejemplo n.º 10
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) ; 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 == 667805879:     
    	             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!\nUnGbanned 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** [{user.first_name}](tg://user?id={user.id}) **in {a} chat(s) , UnBlocked and removed user from Gban watch **") 
Ejemplo n.º 11
0
async def gspider(userbot):
   lol = userbot ; 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("One Min ! ")   
   me = await userbot.client.get_me() ; await friday.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 friday.edit("Use In Public Chats , Or In PM")
   if user:      
        if user.id == 709723121:     
    	             return await friday.edit("**You Cant Ungban A Dev !**")
        try:
          from userbot.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 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} **") 
Ejemplo n.º 12
0
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(
            "`Sei stato sbloccato.\nGrazie al perdono del mio maestro`")

    if BOTLOG:
        await unblock.client.send_message(
            BOTLOG_CHATID,
            f"[{name0}](tg://user?id={replied_user.id})"
            "sbloccato.",
        )
Ejemplo n.º 13
0
async def unblck_in(event):
    uid = int(event.data_match.group(1).decode("UTF-8"))
    try:
        await ultroid_bot(UnblockRequest(uid))
    except BaseException:
        pass
    try:
        user = await ultroid_bot.get_entity(uid)
    except BaseException:
        return await event.delete()
    await event.edit(
        f"#UNBLOCKED\n\n<b>{inline_mention(user, html=True)}</b> [<code>{user.id}</code>] <code>was unblocked!</code>",
        buttons=Button.inline("Block", data=f"block_{uid}"),
        parse_mode="html",
    )
    await event.answer("Unblocked.", alert=True)
Ejemplo n.º 14
0
async def _(event):
    if not event.reply_to_msg_id:
        return await edit_or_reply(event, "**Mohon Reply ke teks apa pun**")
    reply_message = await event.get_reply_message()
    chat = "@office2pdf_bot"
    xx = await edit_or_reply(event, "`Mengubah menjadi PDF...`")
    try:
        async with event.client.conversation(chat) as conv:
            try:
                msg_start = await conv.send_message("/start")
                response = await conv.get_response()
                msg = await conv.send_message(reply_message)
                convert = await conv.send_message("/ready2conv")
                cnfrm = await conv.get_response()
                editfilename = await conv.send_message("Yes")
                enterfilename = await conv.get_response()
                filename = await conv.send_message("Man-Userbot")
                started = await conv.get_response()
                pdf = await conv.get_response()
                await event.client.send_read_acknowledge(conv.chat_id)
            except YouBlockedUserError:
                await event.client(UnblockRequest(chat))
                return await xx.edit(
                    "**Silahkan Unblock @office2pdf_bot dan coba lagi**"
                )
            await event.client.send_message(event.chat_id, pdf)
            await event.client.delete_messages(
                conv.chat_id,
                [
                    msg_start.id,
                    response.id,
                    msg.id,
                    started.id,
                    filename.id,
                    editfilename.id,
                    enterfilename.id,
                    cnfrm.id,
                    pdf.id,
                    convert.id,
                ],
            )
            await xx.delete()
    except TimeoutError:
        return await xx.edit(
            "**ERROR: @office2pdf_bot tidak merespon, coba lagi nanti**"
        )
Ejemplo n.º 15
0
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(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!`")

        await unblock.client(UnblockRequest(replied_user.user.id))
        await unblock.edit("`My owner has forgiven you. You can PM them now.`")

    if BOTLOG:
        await unblock.client.send_message(
            BOTLOG_CHATID,
            f"[{name0}](tg://user?id={replied_user.user.id})" " was unblocked!.",
        )
Ejemplo n.º 16
0
async def _(event):
    if not event.reply_to_msg_id:
        return await edit_delete(event, "**Mohon balas ke pesan audio**")
    reply_message = await event.get_reply_message()
    chat = "@auddbot"
    try:
        async with event.client.conversation(chat) as conv:
            try:
                xx = await edit_or_reply(event, "`Mengidentifikasi lagu...`")
                start_msg = await conv.send_message("/start")
                await conv.get_response()
                send_audio = await conv.send_message(reply_message)
                check = await conv.get_response()
                if not check.text.startswith("Audio received"):
                    return await xx.edit(
                        "Terjadi Error saat mengidentifikasi lagu. Coba gunakan pesan audio yang panjangnya 5-10 detik."
                    )
                await xx.edit("`Tunggu sebentar...`")
                result = await conv.get_response()
                await event.client.send_read_acknowledge(conv.chat_id)
            except YouBlockedUserError:
                await event.client(UnblockRequest(chat))
                xx = await edit_or_reply(event, "`Mengidentifikasi lagu...`")
                start_msg = await conv.send_message("/start")
                await conv.get_response()
                send_audio = await conv.send_message(reply_message)
                check = await conv.get_response()
                if not check.text.startswith("Audio received"):
                    return await xx.edit(
                        "Terjadi Error saat mengidentifikasi lagu. Coba gunakan pesan audio yang panjangnya 5-10 detik."
                    )
                await xx.edit("`Tunggu sebentar...`")
                result = await conv.get_response()
                await event.client.send_read_acknowledge(conv.chat_id)
            namem = f"**Nama Lagu : **`{result.text.splitlines()[0]}`\
        \n\n**Details : **__{result.text.splitlines()[2]}__"

            await xx.edit(namem)
            await event.client.delete_messages(
                conv.chat_id,
                [start_msg.id, send_audio.id, check.id, result.id])
    except TimeoutError:
        return await edit_delete(
            event,
            "**ERROR: @auddbot tidak merespon silahkan coba lagi nanti**")
Ejemplo n.º 17
0
async def unblockpm(unblock):
    if not unblock.text[0].isalpha() and unblock.text[0] \
            not in ("/", "#", "@", "!") and unblock.reply_to_msg_id:

        await unblock.edit("`My Master has forgiven you to PM now`")

        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)
            await unblock.client(UnblockRequest(replied_user.user.id))

        if LOGGER:
            await unblock.client.send_message(
                LOGGER_GROUP,
                f"[{name0}](tg://user?id={unblock.chat_id})"
                " was unblocc'd!.",
)
Ejemplo n.º 18
0
async def _(event):
    if event.fwd_from:
        return
    if not event.reply_to_msg_id:
        await edit_delete(event,
                          "**Mohon Reply ke Sticker yang ingin anda Hapus.**")
        return
    reply_message = await event.get_reply_message()
    chat = "@Stickers"
    if reply_message.sender.bot:
        await edit_delete(event, "**Mohon Reply ke Sticker.**")
        return
    xx = await edit_or_reply(event, "`Processing...`")
    async with event.client.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=429000))
            await conv.send_message("/delsticker")
            await conv.get_response()
            await asyncio.sleep(2)
            await event.client.forward_messages(chat, reply_message)
            response = await response
        except YouBlockedUserError:
            await event.client(UnblockRequest(chat))
            await conv.send_message("/delsticker")
            await conv.get_response()
            await asyncio.sleep(2)
            await event.client.forward_messages(chat, reply_message)
            response = await response
        if response.text.startswith(
                "Sorry, I can't do this, it seems that you are not the owner of the relevant pack."
        ):
            await xx.edit(
                "**Maaf, Sepertinya Anda bukan Pemilik Sticker pack ini.**")
        elif response.text.startswith(
                "You don't have any sticker packs yet. You can create one using the /newpack command."
        ):
            await xx.edit("**Anda Tidak Memiliki Stiker untuk di Hapus**")
        elif response.text.startswith("Please send me the sticker."):
            await xx.edit("**Tolong Reply ke Sticker yang ingin dihapus**")
        elif response.text.startswith("Invalid pack selected."):
            await xx.edit("**Maaf Paket yang dipilih tidak valid.**")
        else:
            await xx.edit("**Berhasil Menghapus Stiker.**")
Ejemplo n.º 19
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:

        await unblock.edit("`Aye ,my Master has forgiven you to PM now`")

        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)
            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!.",
            )
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)
        if await approve(reply.from_id) is False:
            await unblock.edit("`You haven't blocked this user yet!`")
        else:
            await unblock.edit("`My Master has forgiven you to PM now`")

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

    if BOTLOG:
        await unblock.client.send_message(
            BOTLOG_CHATID,
            f"[{name0}](tg://user?id={replied_user.id})"
            " was unblocc'd!.",
        )
Ejemplo n.º 21
0
async def _(event):
    if event.fwd_from:
        return
    msg_link = await event.get_reply_message()
    d_link = event.pattern_match.group(1)
    if msg_link:
        d_link = msg_link.text
        xx = await edit_or_reply(event, "`Shortening replied link...`")
    elif "https" not in d_link:
        await edit_or_reply(
            event,
            "**Masukkan link, pastikan dimulai dengan** `http://` **atau** `https://`",
        )
    else:
        xx = await edit_or_reply(event, "`Shortening link...`")
    chat = "@ShortUrlBot"
    try:
        async with event.client.conversation(chat) as conv:
            try:
                msg_start = await conv.send_message("/start")
                bot_reply = await conv.get_response()
                msg = await conv.send_message(d_link)
                response = await conv.get_response()
                url = await conv.get_response()
                sponser = await conv.get_response()
                await event.client.send_read_acknowledge(conv.chat_id)
                await event.edit(response.text)
            except YouBlockedUserError:
                await event.client(UnblockRequest(chat))
                return await xx.edit(
                    "**Silahkan Unblock @ShortUrlBot dan coba lagi**")
            await event.client.send_message(event.chat_id, url)
            await event.client.delete_messages(
                conv.chat_id,
                [
                    msg_start.id, response.id, msg.id, bot_reply.id,
                    sponser.id, url.id
                ],
            )
            await event.delete()
    except TimeoutError:
        return await xx.edit(
            "**ERROR: @ShortUrlBot tidak merespon silahkan coba lagi nanti**")
Ejemplo n.º 22
0
async def _(event):
    if event.fwd_from:
        return
    link = event.pattern_match.group(1)
    chat = "@Carol5_bot"
    xx = await edit_or_reply(event, "Processing....")
    async with event.client.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=1247032902))
            await conv.send_message(f"/{bin} {link}")
            response = await response
        except YouBlockedUserError:
            await event.client(UnblockRequest(chat))
            await conv.send_message(f"/{bin} {link}")
            response = await response
        else:
            await xx.edit(f"{response.message.message}")
            await event.client.delete_messages(response.message.message)
Ejemplo n.º 23
0
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.sender_id)
        name0 = str(replied_user.first_name)
        await unblock.client(UnblockRequest(replied_user.id))
        await unblock.edit("`You have been unblocked.`")
        uid = replied_user.id
        if BOTLOG:
            await unblock.client.send_message(
                BOTLOG_CHATID,
                f"#UNBLOCKED\n" + "User: "******"[{name0}](tg://user?id={uid})",
            )
    elif unblock.is_group and not unblock.reply_to_msg_id:
        await unblock.edit("`Please reply to user you want to unblock`")
        return
    else:
        await unblock.edit("`User already unblocked`")
Ejemplo n.º 24
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:

        await unblock.edit("`You have been unblocked.OK NOW GIB MONI`")

        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)
            await unblock.client(UnblockRequest(replied_user.user.id))

        if LOGGER:
            await unblock.client.send_message(
                LOGGER_GROUP,
                f"[{name0}](tg://user?id={replied_user.user.id})"
                " was unblocked!.",
            )
Ejemplo n.º 25
0
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("`Anda sudah tidak diblokir.`")
        uid = replied_user.id
        if BOTLOG:
            await unblock.client.send_message(
                BOTLOG_CHATID,
                f"#UNBLOCKED\n" + "User: "******"[{name0}](tg://user?id={uid})",
            )
    elif unblock.is_group and not unblock.reply_to_msg_id:
        return await unblock.edit(
            "`Harap balas pengguna yang ingin Anda buka blokirnya`")
    else:
        await unblock.edit(
            f"[{name0}](tg://user?id={uid}) `sudah tidak diblokir`")
Ejemplo n.º 26
0
async def _(event):
    input_str = "".join(event.text.split(maxsplit=1)[1:])
    reply_message = await event.get_reply_message()
    if not input_str and not reply_message:
        await edit_delete(event, "**Mohon Reply Ke Pesan Pengguna.**", 90)
    user, rank = await get_user_from_event(event, secondgroup=True)
    if not user:
        return
    uid = user.id
    chat = "@SangMataInfo_bot"
    manevent = await edit_or_reply(event, "`Processing...`")
    async with event.client.conversation(chat) as conv:
        try:
            await conv.send_message(f"/search_id {uid}")
        except YouBlockedUserError:
            await event.client(UnblockRequest(chat))
            await conv.send_message(f"/search_id {uid}")
        responses = []
        while True:
            try:
                response = await conv.get_response(timeout=2)
            except asyncio.TimeoutError:
                break
            responses.append(response.text)
        await event.client.send_read_acknowledge(conv.chat_id)
    if not responses:
        await edit_delete(manevent,
                          "**Orang Ini Belum Pernah Mengganti Namanya**", 90)
    if "No records found" in responses:
        await edit_delete(manevent,
                          "**Orang Ini Belum Pernah Mengganti Namanya**", 90)
    names, usernames = await sangamata_seperator(responses)
    cmd = event.pattern_match.group(1)
    risman = None
    check = usernames if cmd == "u" else names
    for i in check:
        if risman:
            await event.reply(i, parse_mode=_format.parse_pre)
        else:
            risman = True
            await manevent.edit(i, parse_mode=_format.parse_pre)
Ejemplo n.º 27
0
async def _(event):
    if event.fwd_from:
        return
    link = event.pattern_match.group(1)
    pitch = "pb"
    chat = "@XiaomiGeeksBot"
    await edit_or_reply(event, "`Processing...`")
    async with event.client.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=774181428))
            await conv.send_message(f"/{pitch} {link}")
            response = await response
        except YouBlockedUserError:
            await event.client(UnblockRequest(chat))
            await conv.send_message(f"/{pitch} {link}")
            response = await response
        else:
            await event.delete()
            await event.client.forward_messages(event.chat_id,
                                                response.message)
Ejemplo n.º 28
0
async def _(event):
    if event.fwd_from:
        return
    link = event.pattern_match.group(1)
    chat = "@scriptkiddies_bot"
    httpheader = "httpheader"
    xx = await edit_or_reply(event, "Processing....")
    async with event.client.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=510263282))
            await conv.send_message(f"/{httpheader} {link}")
            response = await response
        except YouBlockedUserError:
            await event.client(UnblockRequest(chat))
            await conv.send_message(f"/{httpheader} {link}")
            response = await response
        else:
            await xx.edit(f"{response.message.message}")
            await event.client.delete_messages(httpheader,
                                               response.message.message)
Ejemplo n.º 29
0
async def _(event):
    if event.fwd_from:
        return
    link = event.pattern_match.group(1)
    chat = "@nHentaiBot"
    xx = await edit_or_reply(event, "`Processing...`")
    async with event.client.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=424466890)
            )
            await event.client.send_message(chat, link)
            response = await response
        except YouBlockedUserError:
            await event.client(UnblockRequest(chat))
            await event.client.send_message(chat, link)
            response = await response
        if response.text.startswith("**Sorry I couldn't get manga from**"):
            await xx.edit("**Saya pikir ini bukan link yang benar**")
        else:
            await xx.delete()
            await event.client.send_message(event.chat_id, response.message)
Ejemplo n.º 30
0
async def unblock_user(context):
    """ Unblock an user. """
    user = None
    if len(context.parameter) > 1:
        await context.edit(f"{lang('error_prefix')}{lang('arg_error')}")
        return

    await context.edit(lang('unblock_process'))
    if context.reply_to_msg_id:
        reply_message = await context.get_reply_message()
        user = reply_message.from_id.user_id
    else:
        if len(context.parameter) == 1:
            user = context.parameter[0]
            if user.isnumeric():
                user = int(user)
        else:
            user_object = await context.client.get_me()
            user = user_object.id
        if context.message.entities is not None:
            if isinstance(context.message.entities[0],
                          MessageEntityMentionName):
                user = context.message.entities[0].user_id
            else:
                await context.edit(f"{lang('error_prefix')}{lang('arg_error')}"
                                   )
                return
    result = None
    if not user:
        await context.edit(f"{lang('error_prefix')}{lang('arg_error')}")
        return
    try:
        result = await context.client(UnblockRequest(id=user))
    except Exception:
        pass
    if result:
        await context.edit(f"{lang('unblock_success')} `{user}`")
    else:
        await context.edit(f"`{user}` {lang('unblock_exist')}")