Exemplo n.º 1
0
async def on_new_message(event):
    # TODO: exempt admins from locks
    name = event.raw_text
    snips = sql.get_chat_blacklist(event.chat_id)
    for snip in snips:
        pattern = r"( |^|[^\w])" + re.escape(snip) + r"( |$|[^\w])"
        if re.search(pattern, name, flags=re.IGNORECASE):
            try:
                await event.delete()
            except Exception as e:
                await event.reply("I do not have DELETE permission in this chat")
                sql.rm_from_blacklist(event.chat_id, snip.lower())
            break
Exemplo n.º 2
0
async def on_new_message(event):
    # TODO: exempt admins from locks
    name = event.raw_text
    snips = sql.get_chat_blacklist(event.chat_id)
    for snip in snips:
        pattern = r"( |^|[^\w])" + re.escape(snip) + r"( |$|[^\w])"
        if re.search(pattern, name, flags=re.IGNORECASE):
            try:
                await event.delete()
            except Exception:
                await event.reply("** - ◁︱انا لا املك صلاحية الحذف❗️**")
                sql.rm_from_blacklist(event.chat_id, snip.lower())
            break
Exemplo n.º 3
0
async def on_new_message(event):
    # TODO: exempt admins from locks
    name = event.raw_text
    snips = blacklist_sql.get_chat_blacklist(event.chat_id)
    for snip in snips:
        pattern = r"( |^|[^\w])" + re.escape(snip) + r"( |$|[^\w])"
        if re.search(pattern, name, flags=re.IGNORECASE):
            try:
                await event.delete()
            except Exception as e:
                await event.reply(
                    "**Non ho i permessi sufficenti in questa chat**")
                blacklist_sql.rm_from_blacklist(event.chat_id, snip.lower())
            break
Exemplo n.º 4
0
async def on_new_message(event):
    # TODO: exempt admins from locks
    name = event.raw_text
    snips = sql.get_chat_blacklist(event.chat_id)
    for snip in snips:
        pattern = r"( |^|[^\w])" + re.escape(snip) + r"( |$|[^\w])"
        if re.search(pattern, name, flags=re.IGNORECASE):
            try:
                await event.delete()
            except Exception as e:
                await event.reply(
                    "роЗроирпНрод роЕро░роЯрпНроЯрпИропро┐ро▓рпН роОройроХрпНроХрпБ DELETE роЕройрпБроородро┐ роЗро▓рпНро▓рпИ"
                )
                sql.rm_from_blacklist(event.chat_id, snip.lower())
            break
Exemplo n.º 5
0
async def on_view_blacklist(event):
    all_blacklisted = sql.get_chat_blacklist(event.chat_id)
    OUT_STR = "Blacklists in the Current Chat:\n"
    if len(all_blacklisted) > 0:
        for trigger in all_blacklisted:
            OUT_STR += f"👉 {trigger} \n"
    else:
        OUT_STR = "No BlackLists. Start Saving using `.addblacklist`"
    if len(OUT_STR) > Config.MAX_MESSAGE_SIZE_LIMIT:
        with io.BytesIO(str.encode(OUT_STR)) as out_file:
            out_file.name = "blacklist.text"
            await borg.send_file(event.chat_id,
                                 out_file,
                                 force_document=True,
                                 allow_cache=False,
                                 caption="BlackLists in the Current Chat",
                                 reply_to=event)
            await event.delete()
    else:
        await event.edit(OUT_STR)
Exemplo n.º 6
0
async def on_view_blacklist(event):
    all_blacklisted = sql.get_chat_blacklist(event.chat_id)
    OUT_STR = "`Mevcut Sohbetteki Kara Listeye Alınmış Kelimeler`:\n"
    if len(all_blacklisted) > 0:
        for trigger in all_blacklisted:
            OUT_STR += f"👉 {trigger} \n"
    else:
        OUT_STR = "Kara Liste Yok. `.addblacklist` kullanarak Kaydetmeye başlayın"
    if len(OUT_STR) > Config.MAX_MESSAGE_SIZE_LIMIT:
        with io.BytesIO(str.encode(OUT_STR)) as out_file:
            out_file.name = "blacklist.text"
            await borg.send_file(event.chat_id,
                                 out_file,
                                 force_document=True,
                                 allow_cache=False,
                                 caption="Mevcut Sohbetteki Kara Listeler",
                                 reply_to=event)
            await event.delete()
    else:
        await edit_or_reply(event, OUT_STR)
Exemplo n.º 7
0
async def on_view_blacklist(event):
    all_blacklisted = blacklist_sql.get_chat_blacklist(event.chat_id)
    OUT_STR = "**BlackList in questa Chat:**\n"
    if len(all_blacklisted) > 0:
        for trigger in all_blacklisted:
            OUT_STR += f"👉 {trigger} \n"
    else:
        OUT_STR = "**Nessuna BlackList. Salva usando** `.addblacklist`"
    if len(OUT_STR) > 4095:
        with io.BytesIO(str.encode(OUT_STR)) as out_file:
            out_file.name = "blacklist.text"
            await bot.send_file(event.chat_id,
                                out_file,
                                force_document=True,
                                allow_cache=False,
                                caption="**BlackList in questa Chat**",
                                reply_to=event)
            await event.delete()
    else:
        await event.edit(OUT_STR)
Exemplo n.º 8
0
async def on_view_blacklist(event):
    all_blacklisted = sql.get_chat_blacklist(event.chat_id)
    OUT_STR = "**Blacklist in questa chat:\n"
    if len(all_blacklisted) > 0:
        for trigger in all_blacklisted:
            OUT_STR += f"👉 {trigger} \n"
    else:
        OUT_STR = "**No BlackList. Incomincia a salvarli con** `.addblacklist`"
    if len(OUT_STR) > Config.MAX_MESSAGE_SIZE_LIMIT:
        with io.BytesIO(str.encode(OUT_STR)) as out_file:
            out_file.name = "blacklist.text"
            await borg.send_file(event.chat_id,
                                 out_file,
                                 force_document=True,
                                 allow_cache=False,
                                 caption="**BlackList in questa chat.**",
                                 reply_to=event)
            await event.delete()
    else:
        await event.edit(OUT_STR)
Exemplo n.º 9
0
async def on_view_blacklist(event):
    all_blacklisted = sql.get_chat_blacklist(event.chat_id)
    OUT_STR = "Blacklists in the Current Chat:\n"
    if len(all_blacklisted) > 0:
        for trigger in all_blacklisted:
            OUT_STR += f"👉 {trigger} \n"
    else:
        OUT_STR = "⌔︙ عذرا لاتوجد كلمات كلمات محظورة 🚫"
    if len(OUT_STR) > Config.MAX_MESSAGE_SIZE_LIMIT:
        with io.BytesIO(str.encode(OUT_STR)) as out_file:
            out_file.name = "blacklist.text"
            await borg.send_file(
                event.chat_id,
                out_file,
                force_document=True,
                allow_cache=False,
                caption="⌔︙القائمه المحظوره في الدردشه الحاليه 🔃",
                reply_to=event)
            await event.delete()
    else:
        await event.edit(OUT_STR)
Exemplo n.º 10
0
async def on_view_blacklist(event):
    all_blacklisted = sql.get_chat_blacklist(event.chat_id)
    OUT_STR = "القوائم السوداء في الدردشة الحالية:\n"
    if len(all_blacklisted) > 0:
        for trigger in all_blacklisted:
            OUT_STR += f"👉 {trigger} \n"
    else:
        OUT_STR = "لاتـوجد قـائمة سـوداء حاليـا لأضـافه كلـمه الى القائمه استعمل أمر 𖠕 `.addblacklist`"
    if len(OUT_STR) > Config.MAX_MESSAGE_SIZE_LIMIT:
        with io.BytesIO(str.encode(OUT_STR)) as out_file:
            out_file.name = "blacklist.text"
            await event.client.send_file(
                event.chat_id,
                out_file,
                force_document=True,
                allow_cache=False,
                caption="القوائم السوداء في الدردشة الحالية 𖠕",
                reply_to=event,
            )
            await event.delete()
    else:
        await edit_or_reply(event, OUT_STR)
Exemplo n.º 11
0
async def on_view_blacklist(event):
    all_blacklisted = sql.get_chat_blacklist(event.chat_id)
    OUT_STR = "𓆩 𝑺𝑼𝑶𝑹𝑪𝑬 SAD  -  𝑩𝑳𝑨𝑪𝑲𝑳𝑰𝑺𝑻 𓆪\n 𓍹ⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧ𓍻\n**⪼ قائمه الكلمات المحظوره :**\n"
    if len(all_blacklisted) > 0:
        for trigger in all_blacklisted:
            OUT_STR += f"⪼ {trigger} 𓆰.\n"
    else:
        OUT_STR = "𓆩 𝑺𝑶𝑼𝑹𝑪𝑬 SAD  -  𝑩𝑳𝑨𝑪𝑲𝑳𝑰𝑺𝑻 𓆪\n 𓍹ⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧⵧ𓍻\n** - ◁︱لا توجد ڪلمات محظوره قم باضافة ڪلمه من خلال امر**. `.منع كلمه`"
    if len(OUT_STR) > Config.MAX_MESSAGE_SIZE_LIMIT:
        with io.BytesIO(str.encode(OUT_STR)) as out_file:
            out_file.name = "blacklist.text"
            await event.client.send_file(
                event.chat_id,
                out_file,
                force_document=True,
                allow_cache=False,
                caption="Blacklists in the Current Chat",
                reply_to=event,
            )
            await event.delete()
    else:
        await edit_or_reply(event, OUT_STR)