Example #1
0
async def hehehe(event):
    if event.fwd_from:
        return
    chat = await event.get_chat()
    if event.is_private:
        if not pmpermit_sql.is_approved(chat.id):
            pmpermit_sql.approve(chat.id, "**My Boss Is Best🔥**")
            await borg.send_message(
                chat, "**User Detected As Developer. So Approved**")
Example #2
0
async def hehehe(event):
    if event.fwd_from:
        return
    chat = await event.get_chat()
    if event.is_private:
        if not pmpermit_sql.is_approved(chat.id):
            pmpermit_sql.approve(chat.id, "supreme lord ehehe")
            await borg.send_message(
                chat,
                "`This inbox has been blessed by my master. Consider yourself lucky.`\n**Increased Stability and Karma** (づ ̄ ³ ̄)づ",
            )
Example #3
0
 async def approve_p_m(event):
     if event.fwd_from:
         return
     replied_user = await event.client(GetFullUserRequest(event.chat_id))
     firstname = replied_user.user.first_name
     chat = await event.get_chat()
     if event.is_private:
         if pmpermit_sql.is_approved(chat.id):
             pmpermit_sql.disapprove(chat.id)
             await event.edit(
                 "Disapproved User [{}](tg://user?id={})".format(
                     firstname, chat.id))
             await event.delete()
Example #4
0
 async def approve_p_m(event):
     if event.fwd_from:
         return
     replied_user = await event.client(GetFullUserRequest(event.chat_id))
     firstname = replied_user.user.first_name
     chat = await event.get_chat()
     if event.is_private:
         if pmpermit_sql.is_approved(chat.id):
             pmpermit_sql.disapprove(chat.id)
             await event.edit("Blocked [{}](tg://user?id={})".format(
                 firstname, chat.id))
             await asyncio.sleep(3)
             await event.client(functions.contacts.BlockRequest(chat.id))
Example #5
0
 async def block(event):
     if event.fwd_from:
         return
     replied_user = await borg(GetFullUserRequest(event.chat_id))
     firstname = replied_user.user.first_name
     chat = await event.get_chat()
     if event.is_private:
         if not pmpermit_sql.is_approved(chat.id):
             if chat.id in PM_WARNS:
                 del PM_WARNS[chat.id]
             if chat.id in PREV_REPLY_MESSAGE:
                 await PREV_REPLY_MESSAGE[chat.id].delete()
                 del PREV_REPLY_MESSAGE[chat.id]
             pmpermit_sql.approve(chat.id, "Approved Another Nibba")
             await event.edit("Approved to pm [{}](tg://user?id={})".format(
                 firstname, chat.id))
             await asyncio.sleep(3)
             await event.delete()
Example #6
0
    async def on_new_private_message(event):
        if event.sender_id == bot.uid:
            return

        if Var.PRIVATE_GROUP_ID is None:
            return

        if not event.is_private:
            return

        message_text = event.message.message
        chat_id = event.sender_id

        message_text.lower()
        if USER_BOT_NO_WARN == message_text:
            return
        sender = await bot.get_entity(chat_id)

        if chat_id == bot.uid:

            # don't log Saved Messages

            return

        if sender.bot:

            # don't log bots

            return

        if sender.verified:

            # don't log verified accounts

            return

        if PM_ON_OFF == "DISABLE":
            return

        if not pmpermit_sql.is_approved(chat_id):
            # pm permit
            await do_pm_permit_action(chat_id, event)