Пример #1
0
async def echo(event):
  if event.fwd_from:
        return
  if event.sender_id == OWNER_ID:
        pass
  elif sudo(event.sender_id):
        pass
  elif is_admin(event, event.sender_id):
        pass
  else:
        return
  ok = event.pattern_match.group(1)
  if ok:
          if event.reply_to_msg_id:
            previous_message = await event.get_reply_message()
            if previous_message.sender_id == OWNER_ID:
                return await event.reply("F**k you too!")
            try:
              await event.delete()
            except:
              pass
            await tbot.send_message(event.chat_id, ok, reply_to=previous_message.id)
          else:
            try:
              await event.delete()
            except:
              pass
            await tbot.send_message(event.chat_id, ok)

  elif event.reply_to_msg_id:
          previous_message = await event.get_reply_message()
          try:
            await event.delete()
          except Exception:
            pass
          
          k = await tbot.send_message(
                event.chat_id,
                previous_message
             )
  else:
     await tbot.send_message(event.chat_id, f"{event.sender.first_name} Chithiya. Echo krnekeliye kuch ni deta🤨")
Пример #2
0
async def approve(event):
   if event.sender_id == OWNER_ID:
      pass
   elif event.sender_id in DEV_USERS:
      pass
   else:
      return
   sender = event.sender_id
   bl = blacklist.find({})
   reply_msg = await event.get_reply_message()
   iid = reply_msg.sender_id
   if iid == OWNER_ID:
     return
   elif iid in DEV_USERS:
     return
   elif iid in SUDO_USERS:
     return
   elif sudo(iid):
     return
   if event.sender_id == BOT_ID or int(iid) == int(BOT_ID):
        await event.reply("I am not gonna blacklist myself")
        return
   a = blacklist.find({})
   for i in a:
         if iid == i["user"]:
                await event.reply("This User is Already Blacklisted")
                return
   blacklist.insert_one({"user": iid})
   await event.reply("Successfully Blacklisted This Retard")
   loda=""
   try:
     for i in a:
       k = i["user"]
       loda += f"{k}\n"
   except Exception as ok:
       await e.reply(ok)
   await event.reply(loda)
Пример #3
0
async def detail(replied_user, event):
    try:
        user_id = replied_user.user.id
        first_name = replied_user.user.first_name
        last_name = replied_user.user.last_name
        username = replied_user.user.username
        first_name = (first_name.replace("\u2060", ""))
        last_name = (last_name.replace("\u2060", "") if last_name else None)
        username = "******".format(username) if username else None

        caption = "<b>User Info:</b> \n"
        caption += f"ID: <code>{user_id}</code> \n"
        caption += f"First Name: {first_name} \n"
        if last_name:
            caption += f"Last Name: {last_name} \n"
        if username:
            caption += f"Username: {username} \n"
        caption += f'Permalink: <a href="tg://user?id={user_id}">link</a>'
        if is_bio(replied_user.user.id):
            smx = boss[replied_user.user.id]
            caption += f"\n\n<b>What others say:</b>\n{smx}"
        a = blacklist.find({})
        for i in a:
            if user_id == i["user"]:
                caption += "\n\n<b>Blacklisted:</b> Yes"
        chats = gbanned.find({})
        for i in chats:
            if user_id == i["user"]:
                caption += "\n\n<b>Globally Banned:</b> Yes"
        if sudo(user_id):
            caption += "\n\nThis is one of my <b>Sudo Users</b>"
        if user_id == OWNER_ID:
            caption += "\n\nThis is my <b>Owner</b> They have total power over me"
        return caption
    except Exception:
        print("lel")
Пример #4
0
async def gban(event):
    sender = event.sender.first_name
    group = event.chat.title
    if event.fwd_from:
        return
    if event.sender_id == OWNER_ID:
        pass
    elif event.sender_id in DEV_USERS:
        pass
    elif sudo(int(event.sender_id)):
        pass
    else:
        return
    input = event.pattern_match.group(1)
    if input:
        arg = input.split(" ", 1)
    if not event.reply_to_msg_id:
        if len(arg) == 2:
            iid = arg[0]
            reason = arg[1]
        else:
            iid = arg[0]
            reason = "None"
        if not iid.isnumeric():
            username = iid.replace("@", "")
            entity = await tbot.get_input_entity(iid)
            try:
                r_sender_id = entity.user_id
            except Exception:
                await event.reply("Couldn't fetch that user.")
                return
        else:
            r_sender_id = int(iid)
        try:
            replied_user = await tbot(GetFullUserRequest(r_sender_id))
            fname = replied_user.user.first_name
        except Exception:
            fname = "User"
    else:
        reply_message = await event.get_reply_message()
        iid = reply_message.sender_id
        username = reply_message.sender.username
        fname = reply_message.sender.first_name
        if input:
            reason = input
        else:
            reason = "None"
        r_sender_id = iid
    if r_sender_id == OWNER_ID:
        await event.reply(f"Vro Chakka He kya?.­Ъце")
        return
    elif r_sender_id in DEV_USERS:
        await event.reply("This Person is a Dev, Sorry!")
        return
    elif r_sender_id == BOT_ID:
        await event.reply("Another one bits the dust! banned a betichod!")
        return
    elif sudo(r_sender_id):
        await event.reply("Ja Na Nalle.!")
        return
    chats = gbanned.find({})
    for c in chats:
        if r_sender_id == c["user"]:
            to_check = get_reason(id=r_sender_id)
            gbanned.update_one(
                {
                    "_id": to_check["_id"],
                    "bannerid": to_check["bannerid"],
                    "user": to_check["user"],
                    "reason": to_check["reason"],
                },
                {"$set": {
                    "reason": reason,
                    "bannerid": event.sender_id
                }},
            )
            await event.reply(
                "This user is already gbanned, I am updating the reason of the gban with your reason."
            )
            await tbot.send_message(
                GBAN_LOGS,
                "**Global Ban**\n#UPDATE\n**Originated From: {} {}**\n\n**Sudo Admin:** [{}](tg://user?id={})\n**User:** [{}](tg://user?id={})\n**ID:** `{}`\n**New Reason:** {}"
                .format(group, event.chat_id, sender, event.sender_id, fname,
                        r_sender_id, r_sender_id, reason))
            return
    gbanned.insert_one({
        "bannerid": event.sender_id,
        "user": r_sender_id,
        "reason": reason
    })
    k = await event.reply("РџА№ИЈ **Snaps the Banhammer** РџА№ИЈ")
    cheater = get_all_chat_id()
    done = 0
    ti = time.time()
    for i in cheater:
        try:
            chat = int(i.chat_id)
            await tbot(EditBannedRequest(chat, f"{username}", BANNED_RIGHTS))
            done = done + 1
        except Exception:
            pass
    await tbot.send_message(
        GBAN_LOGS,
        "**Global Ban**\n#NEW\n**Originated From: {} {}**\n\n**Sudo Admin:** [{}](tg://user?id={})\n**User:** [{}](tg://user?id={})\n**ID:** `{}`\n**Reason:** {}"
        .format(group, event.chat_id, sender, event.sender_id, fname,
                r_sender_id, r_sender_id, reason))
    tf = time.time()
    timetaken = get_readable_time(tf - ti)
    await event.reply(f"Global Ban Completed!\n**Time Taken:** {timetaken}")
Пример #5
0
async def ugban(event):
    sender = event.sender.first_name
    group = event.chat.title
    id = event.sender_id
    if event.fwd_from:
        return
    if event.sender_id == OWNER_ID:
        pass
    elif event.sender_id in DEV_USERS:
        pass
    elif sudo(id):
        pass
    else:
        return
    input = event.pattern_match.group(1)
    if input:
        arg = input.split(" ", 1)
    if not event.reply_to_msg_id:
        if len(arg) == 2:
            iid = arg[0]
            reason = arg[1]
        else:
            iid = arg[0]
            reason = None
        if not iid.isnumeric():
            username = iid.replace("@", "")
            entity = await tbot.get_input_entity(iid)
            try:
                r_sender_id = entity.user_id
            except Exception:
                await event.reply("Couldn't fetch that user.")
                return
        else:
            r_sender_id = int(iid)
        try:
            replied_user = await tbot(GetFullUserRequest(r_sender_id))
            fname = replied_user.user.first_name
        except Exception:
            fname = "User"
    else:
        reply_message = await event.get_reply_message()
        iid = reply_message.sender_id
        username = reply_message.sender.username
        fname = reply_message.sender.first_name
        if input:
            reason = input
        else:
            reason = None
        r_sender_id = iid
    if r_sender_id == OWNER_ID:
        await event.reply(f"Yeah FuckOff!")
        return
    elif r_sender_id in DEV_USERS:
        await event.reply("No!")
        return
    elif r_sender_id == BOT_ID:
        await event.reply("Who Dafaq Made You Sudo?!")
        return
    elif sudo(r_sender_id):
        await event.reply("Yeah Nibba that's a Sudo User­Ъце")
        return
    chats = gmuted.find({})
    for c in chats:
        if r_sender_id == c["user"]:
            to_check = get_reason(id=r_sender_id)
            gmuted.delete_one({"user": r_sender_id})
            await event.reply("Globally Pardoned This User.!­ЪЈ│№ИЈ")
            await tbot.send_message(
                GBAN_LOGS,
                "**Global Unmute**\n**ID:** `{}`".format(r_sender_id))
            return
    await event.reply("Yeah that user is not in my Gmute list.!?")
Пример #6
0
async def gban(event):
    sender = event.sender.first_name
    group = event.chat.title
    if event.fwd_from:
        return
    if event.sender_id == OWNER_ID:
        pass
    elif event.sender_id in DEV_USERS:
        pass
    elif sudo(event.sender_id):
        pass
    else:
        return
    input = event.pattern_match.group(1)
    if input:
        arg = input.split(" ", 1)
    if not event.reply_to_msg_id:
        if len(arg) == 2:
            iid = arg[0]
            reason = arg[1]
        else:
            iid = arg[0]
            reason = "None"
        if not iid.isnumeric():
            username = iid.replace("@", "")
            entity = await tbot.get_input_entity(iid)
            try:
                r_sender_id = entity.user_id
            except Exception:
                await event.reply("Couldn't fetch that user.")
                return
        else:
            r_sender_id = int(iid)
        try:
            replied_user = await tbot(GetFullUserRequest(r_sender_id))
            fname = replied_user.user.first_name
        except Exception:
            fname = "User"
    else:
        reply_message = await event.get_reply_message()
        iid = reply_message.sender_id
        username = reply_message.sender.username
        fname = reply_message.sender.first_name
        if input:
            reason = input
        else:
            reason = "None"
        r_sender_id = iid
    if r_sender_id == OWNER_ID:
        await event.reply(f"Char Chavanni godhe pe\ngey Mere Lode Pe!.")
        return
    elif r_sender_id in DEV_USERS:
        await event.reply("This Person is a Dev, Sorry!")
        return
    elif r_sender_id == BOT_ID:
        await event.reply("Another one bits the dust! banned a betichod!")
        return
    elif sudo(r_sender_id):
        await event.reply("Yeah Nibba that's a Sudo User­Ъце")
        return
    chats = gmuted.find({})
    for c in chats:
        if r_sender_id == c["user"]:
            to_check = get_reason(id=r_sender_id)
            gmuted.update_one(
                {
                    "_id": to_check["_id"],
                    "bannerid": to_check["bannerid"],
                    "user": to_check["user"],
                    "reason": to_check["reason"],
                },
                {"$set": {
                    "reason": reason,
                    "bannerid": event.sender_id
                }},
            )
            await event.reply(
                "This user is already gmuted, I am updating the reason of the gmute with your reason."
            )
            await tbot.send_message(
                GBAN_LOGS,
                "**Global Mute**\n#UPDATE\n**ID:** `{}`".format(r_sender_id))

    gmuted.insert_one({
        "bannerid": event.sender_id,
        "user": r_sender_id,
        "reason": reason
    })
    await tbot.send_message(
        GBAN_LOGS,
        "**Global Mute**\n**Sudo Admin:** {}\n**User:** {}\n**ID:** `{}`".
        format(sender, fname, r_sender_id))
    await event.reply("Sucessfully Added user to Gmute List!")
Пример #7
0
async def ugban(event):
    sender = event.sender.first_name
    group = event.chat.title
    id = event.sender_id
    if event.fwd_from:
        return
    if event.sender_id == OWNER_ID:
        pass
    elif event.sender_id in DEV_USERS:
        pass
    elif sudo(event.sender_id):
        pass
    else:
        return
    input = event.pattern_match.group(1)
    if input:
        arg = input.split(" ", 1)
    if not event.reply_to_msg_id:
        if len(arg) == 2:
            iid = arg[0]
            reason = arg[1]
        else:
            iid = arg[0]
            reason = None
        if not iid.isnumeric():
            username = iid.replace("@", "")
            entity = await tbot.get_input_entity(iid)
            try:
                r_sender_id = entity.user_id
            except Exception:
                await event.reply("Couldn't fetch that user.")
                return
        else:
            r_sender_id = int(iid)
        try:
            replied_user = await tbot(GetFullUserRequest(r_sender_id))
            fname = replied_user.user.first_name
        except Exception:
            fname = "User"
    else:
        reply_message = await event.get_reply_message()
        iid = reply_message.sender_id
        username = reply_message.sender.username
        fname = reply_message.sender.first_name
        if input:
            reason = input
        else:
            reason = None
        r_sender_id = iid
    if r_sender_id == OWNER_ID:
        await event.reply("Gey Away.")
        return
    elif r_sender_id in DEV_USERS:
        await event.reply("No!")
        return
    elif r_sender_id == BOT_ID:
        await event.reply("Who Dafaq Made You Sudo?!")
        return
    elif sudo(r_sender_id):
        await event.reply("Sudo ko kon ungban krta londe.?")
        return
    chats = gbanned.find({})
    for c in chats:
        if r_sender_id == c["user"]:
            to_check = get_reason(id=r_sender_id)
            gbanned.delete_one({"user": r_sender_id})
            await event.reply("Globally Pardoned This User.!­ЪЈ│№ИЈ")
            await tbot.send_message(
                GBAN_LOGS,
                "**Global Unban**\n#UNGBAN\n**Originated From: {} {}**\n\n**Sudo Admin:** [{}](tg://user?id={})\n**User:** [{}](tg://user?id={})\n**ID:** `{}`\n**Reason:** {}"
                .format(group, event.chat_id, sender, event.sender_id, fname,
                        r_sender_id, r_sender_id, reason))
            return
    await event.reply("Yeah that user is not in my Gbanned list.!?")
Пример #8
0
async def _(event):
    cmd = event.text.split(" ", maxsplit=1)[1]
    if event.sender_id == OWNER_ID:
        pass
    elif event.sender_id in DEV_USERS or sudo(event.sender_id):
        if sql.is_afk(OWNER_ID):
          return await event.reply("Sorry you cannot perform eval function when my master is afk. Try again later.!")
        if "os.environ.get" in cmd:
          await event.reply("Can't access env variables.")
          return
        if "sys.exit" in cmd:
          await event.reply("You have no permission to shutdown Me.")
          return
        if "from Luna import abot" in cmd or "from Luna import STRING_SESSION" in cmd:
          await event.reply("Can't Acess Master Account.")
          return
        if "await tbot.send_message" in cmd or "from Luna import STRING_SESSION" in cmd:
          await event.reply("Ni Hoskta!")
          return
        pass
    else:
        return
    
    reply_to_id = event.message.id
    if event.reply_to_msg_id:
        reply_to_id = event.reply_to_msg_id

    old_stderr = sys.stderr
    old_stdout = sys.stdout
    redirected_output = sys.stdout = io.StringIO()
    redirected_error = sys.stderr = io.StringIO()
    stdout, stderr, exc = None, None, None

    try:
        await aexec(cmd, event)
    except Exception:
        exc = traceback.format_exc()

    stdout = redirected_output.getvalue()
    stderr = redirected_error.getvalue()
    sys.stdout = old_stdout
    sys.stderr = old_stderr
    evaluation = ""
    if exc:
        evaluation = exc
    elif stderr:
        evaluation = stderr
    elif stdout:
        evaluation = stdout
    else:
        evaluation = "Success"
    final_output = "`{}`".format(evaluation)
    MAX_MESSAGE_SIZE_LIMIT = 4095
    if len(final_output) > MAX_MESSAGE_SIZE_LIMIT:
        with io.BytesIO(str.encode(final_output)) as out_file:
            out_file.name = "eval.text"
            await tbot.send_file(
                event.chat_id,
                out_file,
                force_document=True,
                allow_cache=False,
                caption=cmd,
                reply_to=reply_to_id,
            )

    else:
        await event.reply(final_output)