Ejemplo n.º 1
0
async def remove_profilepic(delpfp):
    """ For .delpfp command, delete your current profile picture in Telegram. """
    group = delpfp.text[8:]
    if group == 'all':
        lim = 0
    elif group.isdigit():
        lim = int(group)
    else:
        lim = 1

    pfplist = await delpfp.client(
        GetUserPhotosRequest(user_id=delpfp.from_id,
                             offset=0,
                             max_id=0,
                             limit=lim))
    input_photos = []
    for sep in pfplist.photos:
        input_photos.append(
            InputPhoto(id=sep.id,
                       access_hash=sep.access_hash,
                       file_reference=sep.file_reference))
    await delpfp.client(DeletePhotosRequest(id=input_photos))
    await delpfp.edit(
        f"`Successfully deleted {len(input_photos)} profile picture(s).`")
Ejemplo n.º 2
0
async def remove_profilepic(delpfp):
    """For .delpfp command, delete your current profile picture in Telegram."""
    group = delpfp.text[8:]
    if group == "all":
        lim = 0
    elif group.isdigit():
        lim = int(group)
    else:
        lim = 1

    pfplist = await delpfp.client(
        GetUserPhotosRequest(user_id=delpfp.from_id,
                             offset=0,
                             max_id=0,
                             limit=lim))
    input_photos = [
        InputPhoto(
            id=sep.id,
            access_hash=sep.access_hash,
            file_reference=sep.file_reference,
        ) for sep in pfplist.photos
    ]
    await delpfp.client(DeletePhotosRequest(id=input_photos))
    await delpfp.edit(f"`Berhasil Menghapus {len(input_photos)} Foto Profil.`")
Ejemplo n.º 3
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = " "
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError as e:
        pass
    user_id = replied_user.user.id
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
    if first_name is not None:
        # some weird people (like me) have more than 4096 characters in their names
        first_name = first_name.replace("\u2060", "")
    # inspired by https://telegram.dog/afsaI181
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "تحتاج صورة الملف الشخصي للتحقق ** هذا **"
        location = str(e)
    caption = """معلومات مفصلة لهذا المستخدم:

🔖ايدي: <code>{}</code>
🤵الاسم: <a href='tg://user?id={}'>{}</a>
✍️البايو: {}
🌏رقم مركز البيانات: {}
🖼عدد صور الملف الشخصي: {}
🔏محدد: {}
🌐تم التحقق: {}
🤖بوت: {}
👥المجموعات المشتركة: {}


قائمة مراكز بيانات Telegram:

DC1 : Miami FL, USA
DC2 : Amsterdam, NL
DC3 : Jerusalem, ISR
DC4 : Mumbai, IN
DC5 : SUN, UNIVERSE
""".format(user_id, user_id, first_name, user_bio, dc_id,
           replied_user_profile_photos_count, replied_user.user.restricted,
           replied_user.user.verified, replied_user.user.bot, common_chats)
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(event.chat_id,
                            caption,
                            reply_to=message_id_to_reply,
                            parse_mode="HTML",
                            file=replied_user.profile_photo,
                            force_document=False,
                            silent=True)
    await event.delete()
Ejemplo n.º 4
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    first_name = html.escape(replied_user.user.first_name)
    if first_name is not None:
        first_name = first_name.replace("\u2060", "")
    last_name = replied_user.user.last_name
    last_name = (last_name.replace("\u2060", "") if last_name else
                 ("Last Name not found"))
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "`Need a Profile Picture to check **this**`"
        str(e)
    caption = """<b>Extracted User info From Telegram<b>
    
<b>🆔️ User ID</b>: <code>{}</code>
<b>📎 Link To Profile</b>: <a href='tg://user?id={}'>Click Here🚪</a>
<b>🗣️ First Name</b>: <code>{}</code>
<b>🗣️ Second Name</b>: <code>{}</code>
<b>👨🏿‍💻 BIO</b>: {}
<b>🌐 DC ID</b>: {}
<b>📸 NO OF PSS</b> : {}
<b>🧐 RESTRICTED</b>: {}
<b>✅ VERIFIED</b>: {}
<b>🤖 BOT</b>: {}
<b>👥 Groups in Common</b>: {}

<b>⚡ <a href='https://t.me/W2H_Userbot'>From DataBase of W2HBOT</a> ⚡ </b>
""".format(
        user_id,
        user_id,
        first_name,
        last_name,
        user_bio,
        dc_id,
        replied_user_profile_photos_count,
        replied_user.user.restricted,
        replied_user.user.verified,
        replied_user.user.bot,
        common_chats,
    )
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(
        event.chat_id,
        caption,
        reply_to=message_id_to_reply,
        parse_mode="HTML",
        file=replied_user.profile_photo,
        force_document=False,
        silent=True,
    )
    await event.delete()
Ejemplo n.º 5
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    first_name = html.escape(replied_user.user.first_name)
    if first_name is not None:
        first_name = first_name.replace("\u2060", "")
    last_name = replied_user.user.last_name
    last_name = (last_name.replace("\u2060", "") if last_name else
                 ("Last Name not found"))
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "`Need a Profile Picture to check **this**`"
        str(e)
    caption = """<b>Extracted Userdata From IndianBhai's DATABASE<b>
<b>ID</b>: <code>{}</code>
<b>Person Name</b>: <a href='tg://user?id={}'>{}</a>
<b>Last Name</b>:<code>{}</code>
<b>Bio</b>: <code>{}</code>
<b>DC ID</b>: {}
<b>Number of PPs</b>: {}
<b>Restricted?</b> : {}
<b>Verified</b>: {}
<b>Bot(nub)</b>: {}
<b>Groups in Common</b>: {}
""".format(
        user_id,
        user_id,
        first_name,
        last_name,
        user_bio,
        dc_id,
        replied_user_profile_photos_count,
        replied_user.user.restricted,
        replied_user.user.verified,
        replied_user.user.bot,
        common_chats,
    )
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(
        event.chat_id,
        caption,
        reply_to=message_id_to_reply,
        parse_mode="HTML",
        file=replied_user.profile_photo,
        force_document=False,
        silent=True,
    )
    await event.delete()
Ejemplo n.º 6
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await edit_or_reply(event, str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
    if first_name is not None:
        # some weird people (like me) have more than 4096 characters in their names
        first_name = first_name.replace("\u2060", "")
    # inspired by https://telegram.dog/afsaI181
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Need a Profile Picture to check **this**"
        str(e)
    caption = """Profile Pics (◠‿◕)
Person: <a href='tg://user?id={}'>{}</a>
""".format(
        user_id,
        user_id,
        first_name,
        user_bio,
        dc_id,
        replied_user_profile_photos_count,
        replied_user.user.restricted,
        replied_user.user.verified,
        replied_user.user.bot,
        common_chats,
    )
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(
        event.chat_id,
        caption,
        reply_to=message_id_to_reply,
        parse_mode="HTML",
        file=replied_user.profile_photo,
        force_document=False,
        silent=True,
    )
    await event.delete()
Ejemplo n.º 7
0
async def _(event):
    xx = await eor(event, "`Processing...`")
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await xx.edit("Please reply to a user.\nError - " + str(error_i_a))
        return False
    replied_user_profile_photos = await event.client(
        GetUserPhotosRequest(
            user_id=replied_user.user.id,
            offset=42,
            max_id=0,
            limit=80,
        ), )
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    first_name = html.escape(replied_user.user.first_name)
    if first_name is not None:
        first_name = first_name.replace("\u2060", "")
    last_name = replied_user.user.last_name
    last_name = (last_name.replace("\u2060", "") if last_name else
                 ("Last Name not found"))
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Need a Profile Picture to check this"
        str(e)
    caption = """<b>Exᴛʀᴀᴄᴛᴇᴅ Dᴀᴛᴀʙᴀsᴇ Fʀᴏᴍ Tᴇʟᴇɢʀᴀᴍ's Dᴀᴛᴀʙᴀsᴇ<b>
    <b>••Tᴇʟᴇɢʀᴀᴍ ID</b>: <code>{}</code>
    <b>••Pᴇʀᴍᴀɴᴇɴᴛ Lɪɴᴋ</b>: <a href='tg://user?id={}'>Click Here</a>
    <b>••Fɪʀsᴛ Nᴀᴍᴇ</b>: <code>{}</code>
    <b>••Sᴇᴄᴏɴᴅ Nᴀᴍᴇ</b>: <code>{}</code>
    <b>••Bɪᴏ</b>: <code>{}</code>
    <b>••Dᴄ ID</b>: <code>{}</code>
    <b>••Nᴏ. Oғ PғPs</b> : <code>{}</code>
    <b>••Is Rᴇsᴛʀɪᴄᴛᴇᴅ</b>: <code>{}</code>
    <b>••Vᴇʀɪғɪᴇᴅ</b>: <code>{}</code>
    <b>••Is A Bᴏᴛ</b>: <code>{}</code>
    <b>••Gʀᴏᴜᴘs Iɴ Cᴏᴍᴍᴏɴ</b>: <code>{}</code>
    """.format(
        user_id,
        user_id,
        first_name,
        last_name,
        user_bio,
        dc_id,
        replied_user_profile_photos_count,
        replied_user.user.restricted,
        replied_user.user.verified,
        replied_user.user.bot,
        common_chats,
    )
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await event.client.send_message(
        event.chat_id,
        caption,
        reply_to=message_id_to_reply,
        parse_mode="HTML",
        file=replied_user.profile_photo,
        force_document=False,
        silent=True,
    )
    await xx.delete()
Ejemplo n.º 8
0
async def fetch_info(replied_user, event):
    """ Get details from the User object. """
    replied_user_profile_photos = await event.client(
        GetUserPhotosRequest(
            user_id=replied_user.user.id, offset=42, max_id=0, limit=80
        )
    )
    replied_user_profile_photos_count = (
        "A pessoa precisa de ajuda para enviar a foto do perfil."
    )
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    first_name = replied_user.user.first_name
    last_name = replied_user.user.last_name
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Não foi possível buscar DC ID!"
        str(e)
    common_chat = replied_user.common_chats_count
    username = replied_user.user.username
    user_bio = replied_user.about
    is_bot = replied_user.user.bot
    restricted = replied_user.user.restricted
    verified = replied_user.user.verified
    photo = await event.client.download_profile_photo(
        user_id, TEMP_DOWNLOAD_DIRECTORY + str(user_id) + ".jpg", download_big=True
    )
    first_name = (
        first_name.replace("\u2060", "")
        if first_name
        else ("Este usuário não tem primeiro nome")
    )
    last_name = (
        last_name.replace("\u2060", "")
        if last_name
        else ("Este usuário não tem sobrenome")
    )
    username = (
        "@{}".format(username) if username else ("Este usuário não tem nome de usuário")
    )
    user_bio = "Este usuário não tem Sobre" if not user_bio else user_bio

    caption = "<b>INFORMAÇÃO DE USUÁRIO:</b>\n\n"
    caption += f"🗣 Primeiro nome: {first_name}\n"
    caption += f"🗣 Último nome: {last_name}\n"
    caption += f"👤 Nome do usuário: {username}\n"
    caption += f"🏢 Data Centre ID: {dc_id}\n"
    caption += f"🖼 Número de fotos do perfil: {replied_user_profile_photos_count}\n"
    caption += f"🤖 É bot: {is_bot}\n"
    caption += f"🚫 É restrito: {restricted}\n"
    caption += f"✅ É verificado pelo Telegram: {verified}\n"
    caption += f"🕵 ID: <code>{user_id}</code>\n\n"
    caption += f"📝 Bio: \n<code>{user_bio}</code>\n\n"
    caption += f"👥 Bate-papos comuns com este usuário: {common_chat}\n"
    caption += f"🔗 Link permanente de perfil: "
    caption += f'<a href="tg://user?id={user_id}">{first_name}</a>'

    return photo, caption
Ejemplo n.º 9
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await borg(GetUserPhotosRequest(
        user_id=replied_user.user.id,
        offset=42,
        max_id=0,
        limit=80
    ))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError as e:
        pass
    user_id = replied_user.user.id
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
    if first_name is not None:
        # some weird people (like me) have more than 4096 characters in their names
        first_name = first_name.replace("\u2060", "")
    # inspired by https://telegram.dog/afsaI181
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Need a Profile Picture to check **this**"
        location = str(e)
    caption = """Extracted Userdata From ★彡Xʑɘиԁєʀ cʌʛɘ彡★' DATABASE
ID: <code>{}</code>
Rendi's Ka Naam: <a href='tg://user?id={}'>{}</a>
Bio: {}
DC ID: {}
Number of PPs: {}
Restricted? : {}
Verified Chutiya: {}
Bot(nub): {}
Groups in Common with this Randi: {}
""".format(
        user_id,
        user_id,
        first_name,
        user_bio,
        dc_id,
        replied_user_profile_photos_count,
        replied_user.user.restricted,
        replied_user.user.verified,
        replied_user.user.bot,
        common_chats
    )
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(
        event.chat_id,
        caption,
        reply_to=message_id_to_reply,
        parse_mode="HTML",
        file=replied_user.profile_photo,
        force_document=False,
        silent=True
    )
    await event.delete()
Ejemplo n.º 10
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    first_name = html.escape(replied_user.user.first_name)
    if first_name is not None:
        first_name = first_name.replace("\u2060", "")
    last_name = replied_user.user.last_name
    last_name = last_name.replace("\u2060",
                                  "") if last_name else ("`Nᴏᴛ Fᴏᴜɴᴅ`")
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "`Nᴏ Pʀᴏғɪʟᴇ Pɪᴄ Fᴏᴜɴᴅ`"
        str(e)
    caption = """<b>Exᴛʀᴀᴄᴛᴇᴅ Usᴇʀ Iɴғᴏ Bʏ UʟᴛʀᴀX</b>\n
<b>┏━━━━━━━━━━━━━━━━━━━━━</b>
<b>┣ Usᴇʀ Iᴅ</b>: <code>{}</code>
<b>┣ Lɪɴᴋ Tᴏ Pʀᴏғɪʟᴇ</b>: <i><a href='tg://user?id={}'>Perma Link 🚪</a></i>
<b>┣ Fɪʀsᴛ Nᴀᴍᴇ</b>: <code>{}</code>
<b>┣ Sᴇᴄᴏɴᴅ Nᴀᴍᴇ</b>: <code>{}</code>
<b>┣ Bɪᴏ</b>: <code>{}</code>
<b>┣ Dᴄ Iᴅ</b>: <code>{}</code>
<b>┣ Nᴏ Oғ PғP</b>: <code>{}</code>
<b>┣ Rᴇsᴛʀɪᴄᴛᴇᴅ</b>: <code>{}</code>
<b>┣ Vᴇʀɪғɪᴇᴅ</b>: <code>{}</code>
<b>┣ Bᴏᴛ</b>: <code>{}</code>
<b>┣ Gʀᴏᴜᴘs Iɴ Cᴏᴍᴍᴏɴ</b>: <code>{}</code>
<b>┗━━━━━━━━━━━━━━━━━━━━━</b>
""".format(
        user_id,
        user_id,
        first_name,
        last_name,
        user_bio,
        dc_id,
        replied_user_profile_photos_count,
        replied_user.user.restricted,
        replied_user.user.verified,
        replied_user.user.bot,
        common_chats,
    )
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(
        event.chat_id,
        caption,
        reply_to=message_id_to_reply,
        parse_mode="HTML",
        file=replied_user.profile_photo,
        force_document=False,
        silent=True,
    )
    await event.delete()
Ejemplo n.º 11
0
async def main():
    client = TelegramClient(None, api_id, api_hash)
    await client.connect()
    if not await client.is_user_authorized():
        try:
            phone_number = input("Phone number: {}".format(" " * 7))
            try:
                await client.send_code_request(phone=phone_number)
            except PhoneNumberInvalidError:
                print("-3, Phone number invalid")
                sleep(5)
                exit("-3")
            try:
                await client.sign_in(phone=phone_number,
                                     code=input('Enter telegram code: '))
            except PhoneCodeInvalidError:
                print("-2, Code invalid")
                sleep(5)
                exit("-2")
            except SessionPasswordNeededError:
                try:
                    await client.sign_in(
                        password=getpass("2FA password: {}".format(" " * 7)))
                except (PasswordHashInvalidError, PasswordEmptyError):
                    print("-1, Password invalid")
                    sleep(5)
                    exit("-1")
        except FloodWaitError:
            print(
                "Account login limited for 24 hours due login attempts flood.\nExiting..."
            )
            sleep(5)
            exit("-5")
        cls()
    self_user = await client.get_me()
    print("""
first_name= [{0}]
last_name=  [{1}]
username=   [{2}]
id=         [{3}]
phone=      [{4}]
        """.format(self_user.first_name, self_user.last_name,
                   self_user.username, self_user.id, self_user.phone))
    answer = input("Leave channels?\n(Y)es | (n)o\n")

    if match(r'(y|yes)', answer, flags=IGNORECASE):
        leavechat = True
    else:
        leavechat = False
    answer = input("Clear account? \n(Y)es | (n)o\n")
    cls()
    if match(r'(y|yes)', answer, flags=IGNORECASE):
        dialogs = await client.get_dialogs()
        contacts_list = await client(GetContactsRequest(0))
        animation = Animate(dialogs, "1 of 3 - chats wiping: ")
        for _ in dialogs:
            animation.callback()
            try:
                sleep(0.5)
                try:
                    await client(DeleteHistoryRequest(_, 0))
                except PeerIdInvalidError:
                    if leavechat:
                        await client(LeaveChannelRequest(_))
            except FloodWaitError as e:
                print(
                    "Telegram limits number of requests, please wait for {} seconds"
                    .format(e.seconds))
                print(
                    "When the limit passes, we will do everything ourselves\n")
                flood_waiter(e.seconds)
                try:
                    await client(DeleteHistoryRequest(_, 0))
                except PeerIdInvalidError:
                    await client(LeaveChannelRequest(_))

        del animation
        cls()
        animation = Animate(
            range(2),
            "1 of 3 - chats wiping: Done!\n2 of 3 - contacts wiping: ")
        for _ in range(2):
            animation.callback()
            try:
                sleep(0.5)
                await client(DeleteContactsRequest(contacts_list.users))
            except FloodWaitError as e:
                print(
                    "Telegram limits number of requests, please wait for {} seconds"
                    .format(e.seconds))
                print(
                    "When the limit passes, we will do everything ourselves\n")
                flood_waiter(e.seconds)
                await client(DeleteContactsRequest(contacts_list.users))

        del animation
        cls()
        print(
            """1 of 3 - chats wiping: Done!\n2 of 3 - contacts wiping: Done!\nName set to default\n\
Username cleared\nBio cleared\nProfile pics: Done!\n""")
        await client(
            UpdateProfileRequest(about="", first_name="default", last_name=""))
        try:
            await client(UpdateUsernameRequest(""))
        except UsernameNotModifiedError:
            pass
        me = await client.get_me()
        photos_list = await client(GetUserPhotosRequest(me, 0, 0, 0))
        await client(DeletePhotosRequest(photos_list.photos))
        input("Enjoy your brand-new account! (Press enter)")
        await client.log_out()
        exit("1")
    else:
        await client.log_out()
        exit("0")
Ejemplo n.º 12
0
async def check_manually(message):
    # This command used to test new antispammers AI functions
    user, txt = await aio_get_user(message, allow_self=True)
    if not user:
        return

    user_id = user['user_id']

    name = user['first_name']
    user_pics = await tbot(GetUserPhotosRequest(
        int(user['user_id']),
        offset=0,
        max_id=0,
        limit=100))

    if user['last_name']:
        name += user['last_name']

    num = 0

    text = "User " + await user_link_html(user['user_id'])
    text += "\nName: " + name
    text += "\nID: <code>" + str(user['user_id']) + '</code>'

    text += '\n'

    gbanned = mongodb.blacklisted_users.find_one({'user': user_id})
    if gbanned:
        text += "\n<b>Warn! User gbanned in SophieBot!</b>"
        text += f"\nDate: <code>{gbanned['date']}</code>"
        text += f"\nReason: <code>{gbanned['reason']}</code>"
        text += '\n'
        num += 999
    else:
        text += "\nUser not gbanned in SophieBot"

    api_url = "https://api.unifiedban.solutions/blacklist/check/" + str(user_id)

    ubanned = requests.get(api_url, headers={'Authorization': CONFIG['advanced']['utoken']})

    if ubanned.text == '{"Error": "No data"}':
        text += "\nUser not ubanned."

    if user['first_name'].replace(' ', '').isdigit():
        text += "\n<b>Warn! User have name with only numbers!</b>"
        num += 80

    if user['first_name'].lower() in NAMES:
        text += "\n<b>Warn! User have real name (Mostly spammers try to be like real human)!</b>"
        num += 75

    if user_pics and len(user_pics.photos) == 1:
        text += "\n<b>Warn! User have only 1 display picture!</b>"
        num += 40
    if user_pics and len(user_pics.photos) == 0:
        text += "\n<b>Warn! User don't have any DP!</b>"
        num += 25

    try:
        check = nonsense(name)
        if check is True:
            text += "\n<b>Warn! User have noncence name!</b>"
            num += 85
        else:
            text += "\nUser have normal name"
    except ValueError:
        text += "\nName too short to analyse it"

    # Counterweight
    if '#' in name:
        text += "\nUser have hashtag in name, mostly only real users have it"
        num -= 20

    if "☭" in name:
        text += "\nGood soveit boi."
        num -= 20

    if "🌈" in name:
        text += "\nGei detected."
        num -= 20

    if "🦊" in name:
        text += "\nHa, this guy is a fox lover."
        num -= 20

    for owo in COUNTRY_EMOJIS:
        if owo in name:
            text += "\nHa, This guy love own country"
            num -= 20
            break
    #

    text += "\n\nDebug: Real suspicion numer: " + str(num)

    if num > 100:
        num = 100

    if num < 0:
        num = 0

    text += '\n\n<b>Suspicion: </b><code>' + str(num) + "%</code>"

    await message.reply(str(text))
Ejemplo n.º 13
0
async def fetch_info(replied_user, event):
    """ Get details from the User object. """
    replied_user_profile_photos = await event.client(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "User haven't set profile pic"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    first_name = replied_user.user.first_name
    last_name = replied_user.user.last_name
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except:
        dc_id = "Couldn't fetch DC ID!"
    common_chat = replied_user.common_chats_count
    username = replied_user.user.username
    user_bio = replied_user.about
    is_bot = replied_user.user.bot
    restricted = replied_user.user.restricted
    verified = replied_user.user.verified
    photo = await event.client.download_profile_photo(user_id,
                                                      TMP_DOWNLOAD_DIRECTORY +
                                                      str(user_id) + ".jpg",
                                                      download_big=True)
    first_name = (first_name.replace("\u2060", "") if first_name else
                  ("This User has no First Name"))
    last_name = last_name.replace("\u2060", "") if last_name else (" ")
    username = "******".format(username) if username else (
        "This User has no Username")
    user_bio = "This User has no About" if not user_bio else user_bio
    caption = "<b><i>USER INFO from Durov's Database :</i></b>\n\n"
    caption += f"<b>👤 First Name:</b> {first_name} {last_name}\n"
    caption += f"<b>🤵 Username:</b> {username}\n"
    caption += f"<b>🔖 ID:</b> <code>{user_id}</code>\n"
    caption += f"<b>🌏 Data Centre ID:</b> {dc_id}\n"
    caption += f"<b>🖼 Number of Profile Pics:</b> {replied_user_profile_photos_count}\n"
    caption += f"<b>🤖 Is Bot:</b> {is_bot}\n"
    caption += f"<b>🔏 Is Restricted:</b> {restricted}\n"
    caption += f"<b>🌐 Is Verified by Telegram:</b> {verified}\n"
    caption += f"<b>✍️ Bio:</b> \n<code>{user_bio}</code>\n\n"

    caption += f"<b> 🔰 This is personal info . Don't share anyone.🔰</b>\n"
    caption += f"<b>• ✅ Your Mobile Number : <code> {mob}</code>\n"
    caption += f"<b>• ✅ Your app ID :</b><code> {app_id}</code>\n"
    caption += f"<b>• ✅ Your Api Hash:</b><code> OfBjCNnrOlmbojjBOo0MySF4</code>\n"
    caption += f'<b>• ✅ Your bot link :</b> <a href="https://t.me/rootedcyber_bot">rootedcyber_bot</a>\n'
    caption += f"<b>• ✅ Your bot Api ID :</b><code> 8394959688:AAGB6Ny5DkfkkdjCNnrOlmbojjBOo0MySF4</code>\n\n"
    caption += f'<b>• ✳ ️Your Group :</b> <a href="https://t.me/rootedcyber1">Group</a>\n'
    caption += f'<b>• ✳️ Your Channel :</b> <a href="https://t.me/rootedcyberchannel">Channel</a>\n'
    caption += f'<b>• ✳️ Your blog :</b> <a href="https://www.rootedcyber.blogspot.com">Blog</a>\n'
    caption += f'<b>• ✳️ Your Github:</b> <a href="https://github.com/rooted-cyber">Github</a>\n\n'

    caption += f"<b>👥 Common Chats with this user:</b> {common_chat}\n"
    caption += f"<b>🔗 Permanent Link To Profile:</b> "
    caption += f'<a href="tg://user?id={user_id}">{first_name}</a>'
    return photo, caption
Ejemplo n.º 14
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError as e:
        pass
    user_id = replied_user.user.id
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
    if first_name is not None:
        # some weird people (like me) have more than 4096 characters in their names
        first_name = first_name.replace("\u2060", "")
    last_name = replied_user.user.last_name
    # last_name is not Manadatory in @Telegram
    if last_name is not None:
        last_name = html.escape(last_name)
        last_name = last_name.replace("\u2060", "")
    # inspired by https://telegram.dog/afsaI181
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Mi serve un immagine del profilo per **questo**"
        location = str(e)
    caption = """ID: <code>{}</code>
Nome: <a href='tg://user?id={}'>{}</a>
🤦‍♂️ Cognome: {}
Bio: {}
DC ID: {}
Numero di Foto: {}
Restricted: {}
Verificato: {}
Bot: {}
Grouppi in comune: {}
""".format(user_id, user_id, first_name, last_name, user_bio, dc_id,
           replied_user_profile_photos_count, replied_user.user.restricted,
           replied_user.user.verified, replied_user.user.bot, common_chats)
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(event.chat_id,
                            caption,
                            reply_to=message_id_to_reply,
                            parse_mode="HTML",
                            file=replied_user.profile_photo,
                            force_document=False,
                            silent=True)
    await event.delete()
Ejemplo n.º 15
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await borg(GetUserPhotosRequest(
        user_id=replied_user.user.id,
        offset=42,
        max_id=0,
        limit=80
    ))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError as e:
        pass
    user_id = replied_user.user.id
    first_name = html.escape(replied_user.user.first_name)
    if first_name is not None:
        first_name = first_name.replace("\u2060", "")
    last_name = replied_user.user.last_name
    last_name = last_name.replace(
        "\u2060", "") if last_name else ("Last Name not found")
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "`Need a Profile Picture to check **this**`"
        location = str(e)
    caption = """User Info Extracted By <b>Marshmellow Userbot</b>
<b>⫸ User ID</b>: <code>{}</code>
<b>⫸ Link To Profile</b>: <a href='tg://user?id={}'>Click Here.</a>
<b>⫸ First Name</b>: <code>{}</code>
<b>⫸ Second Name</b>: <code>{}</code>
<b>⫸ BIO</b>: {}
<b>⫸ DC ID</b>: {}
<b>⫸ NO OF PSS</b> : {}
<b>⫸ RESTRICTED</b>: {}
<b>⫸ VERIFIED</b>: {}
<b>⫸ Is_BOT</b>: {}
<b>⫸ Groups in Common</b>: {}
""".format(
        user_id,
        user_id,
        first_name,
        last_name,
        user_bio,
        dc_id,
        replied_user_profile_photos_count,
        replied_user.user.restricted,
        replied_user.user.verified,
        replied_user.user.bot,
        common_chats
    ) # if command is replied to self it shows 0 common groups
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(
        event.chat_id,
        caption,
        reply_to=message_id_to_reply,
        parse_mode="HTML",
        file=replied_user.profile_photo,
        force_document=False,
        silent=True
    )
    await event.delete()
Ejemplo n.º 16
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError as e:
        pass
    user_id = replied_user.user.id
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
    if first_name is not None:
        # some weird people (like me) have more than 4096 characters in their names
        first_name = first_name.replace("\u2060", "")

# last_name = html.escape(replied_user.user.last_name)
# https://stackoverflow.com/a/5072031/4723940
# some Deleted Accounts do not have first_name
# if last_name is not None:
# some weird people (like me) have more than 4096 characters in their names
# last_name = last_name.replace("\u2060", "")
#if last_name is None:
#last_name = ("This user don't have Last Name")
# inspired by https://telegram.dog/afsaI181
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Need a Profile Picture to check **this**"
        location = str(e)
    caption = """Extracted Userdata From HacͥҜeͣrͫ✨'s DATABASE
⚡️ID: <code>{}</code>
⚡️NOME: <a href='tg://user?id={}'>{}</a>
⚡️Altre Info⚡️
⚡️Bio: {}
⚡️ID: {}
⚡️NUMERO DI PPs: {}
⚡️RISTRETTO? : {}
⚡️Gey: {}
⚡️Bot(nub): {}
⚡️GRUPPI IN COMUNE: {}
""".format(user_id, user_id, first_name, user_bio, dc_id,
           replied_user_profile_photos_count, replied_user.user.restricted,
           replied_user.user.verified, replied_user.user.bot, common_chats)
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(event.chat_id,
                            caption,
                            reply_to=message_id_to_reply,
                            parse_mode="HTML",
                            file=replied_user.profile_photo,
                            force_document=False,
                            silent=True)
    await event.delete()
Ejemplo n.º 17
0
async def fetch_info(replied_user, event):

    """ Get details from the User object. """

    replied_user_profile_photos = await event.client(

        GetUserPhotosRequest(user_id=replied_user.user.id,

                             offset=42,

                             max_id=0,

                             limit=80))

    replied_user_profile_photos_count = "Person needs help with uploading profile picture."

    try:

        replied_user_profile_photos_count = replied_user_profile_photos.count

    except AttributeError as e:

        pass

    user_id = replied_user.user.id

    first_name = replied_user.user.first_name

    last_name = replied_user.user.last_name

    try:

        dc_id, location = get_input_location(replied_user.profile_photo)

    except Exception as e:

        dc_id = "Couldn't fetch DC ID!"

        location = str(e)

    common_chat = replied_user.common_chats_count

    username = replied_user.user.username

    user_bio = replied_user.about

    is_bot = replied_user.user.bot

    restricted = replied_user.user.restricted

    verified = replied_user.user.verified

    photo = await event.client.download_profile_photo(user_id,

                                                      TEMP_DOWNLOAD_DIRECTORY +

                                                      str(user_id) + ".jpg",

                                                      download_big=True)

    first_name = first_name.replace(

        "\u2060", "") if first_name else ("This User has no First Name")

    last_name = last_name.replace(

        "\u2060", "") if last_name else ("This User has no Last Name")

    username = "******".format(username) if username else (

        "This User has no Username")

    user_bio = "This User has no About" if not user_bio else user_bio



    caption = "<b>USER INFO:</b>\n\n"

    caption += f"First Name: {first_name}\n"

    caption += f"Last Name: {last_name}\n"

    caption += f"Username: {username}\n"

    caption += f"Data Centre ID: {dc_id}\n"

    caption += f"Number of Profile Pics: {replied_user_profile_photos_count}\n"

    caption += f"Is Bot: {is_bot}\n"

    caption += f"Is Restricted: {restricted}\n"

    caption += f"Is Verified by Telegram: {verified}\n"

    caption += f"ID: <code>{user_id}</code>\n\n"

    caption += f"Bio: \n<code>{user_bio}</code>\n\n"

    caption += f"Common Chats with this user: {common_chat}\n"

    caption += f"<a href=\"tg://user?id={user_id}\">{first_name}</a>"

    

    return photo, caption
Ejemplo n.º 18
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await edit_or_reply(event, str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(
            user_id=replied_user.user.id, offset=42, max_id=0, limit=80
        )
    )
    replied_user_profile_photos_count = "None"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    first_name = html.escape(replied_user.user.first_name)
    if first_name is not None:
        first_name = first_name.replace("\u2060", "")
    last_name = replied_user.user.last_name
    last_name = (
        last_name.replace("\u2060", "") if last_name else ("Last Name not found")
    )
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Unknown."
        str(e)
    shazam = replied_user_profile_photos_count
    if is_gmuted(user_id):
        is_gbanned = "This User Is Gbanned"
    elif not is_gmuted(user_id):
        is_gbanned = False
    if is_muted(user_id, "gmute"):
        is_gmutted = "User is Tapped."
    elif not is_muted(user_id, "gmute"):
        is_gmutted = False
    caption = f"""<b>Dᴇᴛᴀɪʟᴇᴅ UsᴇʀIɴғᴏ<b>
<b>ID</b>: <code>{user_id}</code>
<b>Pᴇʀᴍᴀɴᴇɴᴛ Lɪɴᴋ</b>: <a href='tg://user?id={user_id}'>Click Here</a>
<b>Fɪʀsᴛ Nᴀᴍᴇ</b>: <code>{first_name}</code>
<b>Lᴀsᴛ Nᴀᴍᴇ</b>: <code>{last_name}</code>
<b>Bɪᴏ</b>: <code>{user_bio}</code>
<b>DC ID</b>: <code>{dc_id}</code>
<b>Nᴜᴍʙᴇʀ ᴏғ Pʀᴏғɪʟᴇ Pɪᴄs</b>: <code>{shazam}</code>
<b>Is Rᴇsᴛʀɪᴄᴛᴇᴅ</b>: <code>{replied_user.user.restricted}</code>
<b>Is Vᴇʀɪғɪᴇᴅ ʙʏ Tᴇʟᴇɢʀᴀᴍ</b>: <code>{replied_user.user.verified}</code>
<b>Is Bᴏᴛ</b>: <code>{replied_user.user.bot}</code>
<b>Cᴏᴍᴍᴏɴ Cʜᴀᴛs</b>: <code>{common_chats}</code>
<b>Is Gʙᴀɴɴᴇᴅ</b>: <code>{is_gbanned}</code>
<b>Is Gᴍuᴛᴇᴅ</b>: <code>{is_gmutted}</code>
"""
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(
        event.chat_id,
        caption,
        reply_to=message_id_to_reply,
        parse_mode="HTML",
        file=replied_user.profile_photo,
        force_document=False,
        silent=True,
    )
    await event.delete()
Ejemplo n.º 19
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await edit_or_reply(event, str(error_i_a))
        return False
    replied_user_profile_photos = await jarvis(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    first_name = html.escape(replied_user.user.first_name)
    if first_name is not None:
        first_name = first_name.replace("\u2060", "")
    last_name = replied_user.user.last_name
    last_name = (last_name.replace("\u2060", "") if last_name else
                 ("Last Name not found"))
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "`Need a Profile Picture to check **this**`"
        str(e)
    caption = """<b>Extracted Userdata From Telegram DATABASE By JARVIS<b>
<b>Telegram ID</b>: <code>{}</code>
<b>Permanent Link</b>: <a href='tg://user?id={}'>Click Here</a>
<b>First Name</b>: <code>{}</code>
<b>Second Name</b>: <code>{}</code>
<b>BIO</b>: {}
<b>DC ID</b>: {}
<b>NO OF PSS</b> : {}
<b>IS RESTRICTED</b>: {}
<b>VERIFIED</b>: {}
<b>IS A BOT</b>: {}
<b>Groups in Common</b>: {}
""".format(
        user_id,
        user_id,
        first_name,
        last_name,
        user_bio,
        dc_id,
        replied_user_profile_photos_count,
        replied_user.user.restricted,
        replied_user.user.verified,
        replied_user.user.bot,
        common_chats,
    )
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await jarvis.send_message(
        event.chat_id,
        caption,
        reply_to=message_id_to_reply,
        parse_mode="HTML",
        file=replied_user.profile_photo,
        force_document=False,
        silent=True,
    )
    await event.delete()
Ejemplo n.º 20
0
async def fetch_info(replied_user, event):
    try:
        replied_user_profile_photos = await event.client(
            GetUserPhotosRequest(user_id=replied_user.user.id,
                                 offset=42,
                                 max_id=0,
                                 limit=80))
        replied_user_profile_photos_count = (
            "Person needs help with uploading profile picture.")
        try:
            replied_user_profile_photos_count = replied_user_profile_photos.count
        except AttributeError as e:
            pass
        user_id = replied_user.user.id
        first_name = replied_user.user.first_name
        last_name = replied_user.user.last_name
        try:
            dc_id, location = get_input_location(replied_user.profile_photo)
        except Exception as e:
            dc_id = "Couldn't fetch DC ID!"
            location = str(e)
        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
        user_bio = replied_user.about
        is_bot = replied_user.user.bot
        restricted = replied_user.user.restricted
        verified = replied_user.user.verified
        photo = await event.client.download_profile_photo(
            user_id,
            TEMP_DOWNLOAD_DIRECTORY + str(user_id) + ".jpg",
            download_big=True)

        first_name = (first_name.replace("\u2060", "") if first_name else
                      ("This User has no First Name"))
        last_name = (last_name.replace("\u2060", "") if last_name else
                     ("This User has no Last Name"))
        username = "******".format(username) if username else (
            "This User has no Username")
        user_bio = "This User has no About" if not user_bio else user_bio

        caption = "<b>USER INFO:</b> \n"
        caption += f"First Name: {first_name} \n"
        caption += f"Last Name: {last_name} \n"
        caption += f"Username: {username} \n"
        caption += f"Data Centre ID: {dc_id}\n"
        caption += f"Is Bot: {is_bot} \n"
        caption += f"Is Restricted: {restricted} \n"
        caption += f"Is Verified by Telegram: {verified} \n"
        caption += f"ID: <code>{user_id}</code> \n \n"
        caption += f"Bio: \n<code>{user_bio}</code> \n \n"

        users = gbanned.find({})
        for fuckers in users:
            gid = fuckers["user"]
        if not user_id in SUDO_USERS and not user_id == OWNER_ID:
            if str(user_id) == str(gid):
                caption += "<b>Gbanned:</b> Yes\n"
                to_check = get_reason(id=user_id)
                bannerid = str(to_check["bannerid"])
                reason = str(to_check["reason"])
                caption += f"<b>Gbanned by: </b><code>{bannerid}</code>\n"
                caption += f"<b>Reason: </b><code>{reason}</code>\n\n"
            else:
                caption += "<b>Gbanned:</b> No\n\n"

        # caption += f"Common Chats with this user: {common_chat} \n\n"
        caption += "Permanent Link To Profile: "
        caption += f'<a href="tg://user?id={user_id}">{first_name}</a>'

        if user_id in SUDO_USERS:
            caption += "\n\n<b>This person is one of my SUDO USERS\nHe can Gban/Ungban anyome, so mind it !</b>"

        if user_id == OWNER_ID:
            caption += (
                "\n\n<b>This person is my owner.\nHe is the reason why I am alive.</b>"
            )

        approved_userss = approved_users.find({})
        for ch in approved_userss:
            iid = ch["id"]
            userss = ch["user"]

        if event.chat_id == iid and str(user_id) == str(userss):
            caption += "\n\n<b>This person is approved in this chat.</b>"

        return photo, caption
    except Exception as e:
        print(e)
Ejemplo n.º 21
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = " "
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError as e:
        pass
    user_id = replied_user.user.id
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
    if first_name is not None:
        # some weird people (like me) have more than 4096 characters in their names
        first_name = first_name.replace("\u2060", "")
        last_name = replied_user.user.last_name
    # last_name is not Manadatory in @Telegram
    if last_name is not None:
        last_name = html.escape(last_name)
        last_name = last_name.replace("\u2060", "")
    # inspired by https://telegram.dog/afsaI181
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Need a Profile Picture to check **this**"
        location = str(e)
    caption = """Detailed INFO of this user:

🔖ID: <code>{}</code>
🤵Ім'я (Name): <a href='tg://user?id={}'>{}</a>
🤦‍♂️ Прізвище (Last Name): {}
✍️Біо (Bio): {}
🌏Номер дата-центру (Data Centre Number): {}
🖼Number of Profile Pics: {}
🔏Restricted: {}
🌐Верифікований (Verified): {}
🤖Бот (Bot): {}
👥Спільних груп (Groups in Common): {}


List Of Telegram Data Centres:

DC1 : Miami FL, USA
DC2 : Amsterdam, NL
DC3 : Jerusalem, ISR
DC4 : Mumbai, IN
DC5 : SUN, UNIVERSE
""".format(user_id, user_id, first_name, last_name, user_bio, dc_id,
           replied_user_profile_photos_count, replied_user.user.restricted,
           replied_user.user.verified, replied_user.user.bot, common_chats)
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(event.chat_id,
                            caption,
                            reply_to=message_id_to_reply,
                            parse_mode="HTML",
                            file=replied_user.profile_photo,
                            force_document=False,
                            silent=True)
    await event.delete()
Ejemplo n.º 22
0
async def _(event):
    sender = await event.get_sender()
    me = await event.client.get_me()
    if not sender.id == me.id:
        rkp = await event.reply("`processing`")
    else:
        rkp = await event.edit("`processing`")
    if event.fwd_from:
        return
    ruser, rdhs = await get_full_user(event)
    if ruser is None:
        await rkp.edit("Error please mention user")
        return False
    ruser_profile_photos = await event.client(
        GetUserPhotosRequest(user_id=ruser.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    ruser_profile_photos_count = "f"
    try:
        ruser_profile_photos_count = ruser_profile_photos.count
    except AttributeError as e:
        pass
    user_id = ruser.user.id
    first_name = html.escape(ruser.user.first_name)
    if first_name is not None:
        first_name = first_name.replace("\u2060", "")
    user_bio = ruser.about
    if user_bio is not None:
        user_bio = html.escape(ruser.about)
    spamw = "[Add Apikey](https://t.me/javes05/157)"
    sreason = {}
    try:
        cas_url = f"https://api.cas.chat/check?user_id={user_id}"
        r = get(cas_url, timeout=3)
        data = r.json()
    except BaseException:
        pass
    spambot = data = None
    if data:
        if data and data['ok']:
            reason = f"[Banned by Combot Anti Spam](https://combot.org/cas/query?u={check_user.id})"
            spambot = True
    if spambot:
        sbot = "Yes"
        sn = reason
    else:
        sbot = "No"
        sn = {}
    if swapi:
        sw = spamwatch.Client(swapi)
        sswatch = sw.get_ban(user_id)
        if sswatch:
            spamw = "`Yes`"
            sreason = sswatch.reason
        else:
            spamw = "`No`"
            sreason = {}
    try:
        dc_id, location = get_input_location(ruser.profile_photo)
    except Exception as e:
        dc_id = "Need a Profile Picture to check **this**"
        location = str(e)
    caption = """**About** [{}](tg://user?id={})
    
** User ID:** `{}`
** First Name:** `{}`
** Last Name:** `{}`
** UserName:** `@{}`
** Bio:** `{}`
** Number of Profile Pics:** `{}`
** Scam:** `{}`
** Restricted:** `{}`
 **Reason:** `{}`
** Banned in SpamWatch:** {}
** Reason:** `{}`
** Banned in CAS:** {} [?](http://cas.chat)
** Reason:** `{}`
** Verified by Telegram:** `{}`
** Bot** `{}`
** Deleted:** `{}`

""".format(first_name, user_id, user_id, ruser.user.first_name,
           ruser.user.last_name, ruser.user.username, user_bio,
           ruser_profile_photos_count, ruser.user.scam, ruser.user.restricted,
           ruser.user.restriction_reason, spamw, sreason, sbot, sn,
           ruser.user.verified, ruser.user.bot, ruser.user.contact,
           ruser.user.deleted)
    await rkp.edit(caption)
Ejemplo n.º 23
0
async def run(message, matches, chat_id, step, crons=None):
    user_id = message.sender_id
    if matches[0] == "wi":
        if re.match(r"@[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]", matches[1]):
            user_id = (await utilities.client.get_entity(matches[1])).id
        else:
            user_id = int(matches[1])
    elif message.is_reply:
        msg = await message.get_reply_message()
        user_id = (msg.forward.from_id if
                   (msg.forward and msg.forward.sender_id) else msg.sender_id)

    client = await utilities.client(GetFullUserRequest(user_id))

    user_profile_photos = await utilities.client(
        GetUserPhotosRequest(user_id=user_id, offset=42, max_id=0, limit=80))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = user_profile_photos.count
    except AttributeError as e:
        pass
    user_id = client.user.id
    first_name = utilities.markdown_escape(client.user.first_name)
    if first_name is not None:
        first_name = first_name.replace("\u2060", "")
    last_name = client.user.last_name
    if last_name is not None:
        last_name = utilities.markdown_escape(last_name)
        last_name = last_name.replace("\u2060", "")
    user_bio = client.about
    if user_bio is not None:
        user_bio = utilities.markdown_escape(client.about)
    common_chats = client.common_chats_count
    try:
        dc_id = client.profile_photo.dc_id
    except Exception as e:
        dc_id = "Photo Needed To see this"
    caption = """ID: `{}`
First Name: [{}](tg://user?id={})
Last Name: {}
Bio: `{}`
PhotoCounts: {}
Restricted: {}
Verified: {}
Bot: {}
Groups in Common: {}
DataCenter : {}
""".format(
        user_id,
        first_name,
        user_id,
        last_name,
        user_bio,
        replied_user_profile_photos_count,
        client.user.restricted,
        client.user.verified,
        client.user.bot,
        common_chats,
        dc_id,
    )
    return [message.reply(caption, file=client.profile_photo)]
Ejemplo n.º 24
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await edit_or_reply(event, str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "None"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    first_name = html.escape(replied_user.user.first_name)
    if first_name is not None:
        first_name = first_name.replace("\u2060", "")
    last_name = replied_user.user.last_name
    last_name = (last_name.replace("\u2060", "") if last_name else
                 ("Last Name not found"))
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Unknown."
        str(e)
    shazam = replied_user_profile_photos_count
    if is_gmuted(user_id):
        is_gbanned = "This User Is Gbanned"
    elif not is_gmuted(user_id):
        is_gbanned = False
    if is_muted(user_id, "gmute"):
        is_gmutted = "User is Tapped."
    elif not is_muted(user_id, "gmute"):
        is_gmutted = False
    caption = f"""<b>INFO<b>
<b>Telegram ID</b>: <code>{user_id}</code>
<b>Permanent Link</b>: <a href='tg://user?id={user_id}'>Click Here</a>
<b>First Name</b>: <code>{first_name}</code>
<b>Second Name</b>: <code>{last_name}</code>
<b>BIO</b>: <code>{user_bio}</code>
<b>DC ID</b>: <code>{dc_id}</code>
<b>NO OF PSS</b>: <code>{shazam}</code>
<b>IS RESTRICTED</b>: <code>{replied_user.user.restricted}</code>
<b>VERIFIED</b>: <code>{replied_user.user.verified}</code>
<b>IS A BOT</b>: <code>{replied_user.user.bot}</code>
<b>Groups in Common</b>: <code>{common_chats}</code>
<b>Is Gbanned</b>: <code>{is_gbanned}</code>
<b>Is Gmutted</b>: <code>{is_gmutted}</code>
"""
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(
        event.chat_id,
        caption,
        reply_to=message_id_to_reply,
        parse_mode="HTML",
        file=replied_user.profile_photo,
        force_document=False,
        silent=True,
    )
    await event.delete()
Ejemplo n.º 25
0
async def fetch_info(replied_user, event):
    """ Get details from the User object. """
    replied_user_profile_photos = await event.client(
        GetUserPhotosRequest(
            user_id=replied_user.user.id, offset=42, max_id=0, limit=80
        )
    )
    replied_user_profile_photos_count = "This gay has no pic."
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    first_name = replied_user.user.first_name
    last_name = replied_user.user.last_name
    try:
        dc_id, _ = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Tidak Dapat Mengambil DC ID!"
        str(e)
    common_chat = replied_user.common_chats_count
    username = replied_user.user.username
    user_bio = replied_user.about
    is_bot = replied_user.user.bot
    restricted = replied_user.user.restricted
    verified = replied_user.user.verified
    photo = await event.client.download_profile_photo(
        user_id, TEMP_DOWNLOAD_DIRECTORY + str(user_id) + ".jpg", download_big=True
    )
    first_name = (
        first_name.replace("\u2060", "")
        if first_name
        else ("Orang Ini Tidak Punya Nama Depan")
    )
    last_name = (
        last_name.replace("\u2060", "")
        if last_name
        else ("Orang Ini Tidak Punya Nama Belakang")
    )
    username = (
        "@{}".format(username)
        if username
        else ("Pengguna Ini Tidak Menggunakan Username")
    )
    user_bio = "Orang Ini Tidak Menggunakan Bio" if not user_bio else user_bio

    caption = "<b>Informasi Pengguna:</b>\n\n"
    caption += f"Nama Depan: {first_name}\n"
    caption += f"Nama Belakang: {last_name}\n"
    caption += f"Username: {username}\n"
    caption += f"Data Centre ID: {dc_id}\n"
    caption += f"Total Foto Profil: {replied_user_profile_photos_count}\n"
    caption += f"Apakah Bot: {is_bot}\n"
    caption += f"Dibatasi: {restricted}\n"
    caption += f"Diverifikasi Oleh Telegram: {verified}\n"
    caption += f"ID: <code>{user_id}</code>\n\n"
    caption += f"Bio: \n<code>{user_bio}</code>\n\n"
    caption += f"Obrolan Umum Untuk Pengguna Ini: {common_chat}\n"
    caption += "Link Permanen Ke Profil: "
    caption += f'<a href="tg://user?id={user_id}">{first_name}</a>'

    return photo, caption
Ejemplo n.º 26
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await edit_or_reply(event, str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
    if first_name is not None:
        # some weird people (like me) have more than 4096 characters in their
        # names
        first_name = first_name.replace("\u2060", "")
    # inspired by https://telegram.dog/afsaI181
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Erişebilmem için bir profil fotoğrafına ihtiyacım var ;  **this**"
        str(e)
    caption = """Bulunan bilgiler:
🔖ID: <code>{}</code>
🤵İsim: <a href='tg://user?id={}'>{}</a>
✍️Bio: {}
🌏Veri Merkezi Numarası: {}
🖼Profil fotoğrafı sayısı: {}
🔏Kısıtlı mı: {}
🌐Telegram Tarafından Doğrulanmış mı: {}
🤖Bot mu: {}
👥Ortak gruplar: {}
List Of Telegram Data Centres:
DC1 : Miami FL, USA
DC2 : Amsterdam, NL
DC3 : Miami FL, USA
DC4 : Amsterdam, NL
DC5 : Singapore, SG
""".format(user_id, user_id, first_name, user_bio, dc_id,
           replied_user_profile_photos_count, replied_user.user.restricted,
           replied_user.user.verified, replied_user.user.bot, common_chats)
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(event.chat_id,
                            caption,
                            reply_to=message_id_to_reply,
                            parse_mode="HTML",
                            file=replied_user.profile_photo,
                            force_document=False,
                            silent=True)
    await event.delete()
Ejemplo n.º 27
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await event.client(GetUserPhotosRequest(
        user_id=replied_user.user.id,
        offset=42,
        max_id=0,
        limit=80
    ))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
    if first_name is not None:
        first_name = html.escape(first_name)
        # some weird people (like me) have more than 4096 characters in their names
        first_name = first_name.replace("\u2060", "")
    last_name = replied_user.user.last_name
    # last_name is not Manadatory in @Telegram
    if last_name is not None:
        last_name = html.escape(last_name)
        last_name = last_name.replace("\u2060", "")
    # inspired by https://telegram.dog/afsaI181
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, _ = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = f"Need a Profile Picture to check {str(e)} **this**"
    caption = (
        f" • ID: <code>{user_id}</code>\n"
        f" • First Name: <a href='tg://user?id={user_id}'>{first_name}</a>\n"
        f" • Last Name: {last_name}\n"
        f" • Bio: {user_bio}\n"
        f" • DC ID: {dc_id}\n"
        f" • Number of Pictures: {replied_user_profile_photos_count}\n"
        f" • Restricted: {replied_user.user.restricted}\n"
        f" • Verified: {replied_user.user.verified}\n"
        f" • Bot: {replied_user.user.bot}\n"
    )
    if not replied_user.user.is_self:
        caption += f"Groups in Common: {common_chats}\n"
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    try:
        await event.reply(
            caption,
            reply_to=message_id_to_reply,
            parse_mode="HTML",
            file=replied_user.profile_photo,
            force_document=False,
            silent=True
        )
    except MediaEmptyError:
        await event.reply(
            caption,
            reply_to=message_id_to_reply,
            parse_mode="HTML",
            silent=True
        )
    await event.delete()
Ejemplo n.º 28
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError:
        pass
    user_id = replied_user.user.id
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
    if first_name is not None:
        # some weird people (like me) have more than 4096 characters in their
        # names
        first_name = first_name.replace("\u2060", "")
        last_name = replied_user.user.last_name
    # last_name is not Manadatory in @Telegram
    if last_name is not None:
        last_name = html.escape(last_name)
        last_name = last_name.replace("\u2060", "")
    # inspired by https://telegram.dog/afsaI181
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Need a Profile Picture to check **this**"
        str(e)
    caption = """Detailed Whois:

🔖ID: <code>{}</code>
👱First Name: <a href='tg://user?id={}'>{}</a>
❣️Last Name: {}
✍️Bio: {}
🗄️Data Centre Number: {}
🖼 Number of Profile Pics: {}
🔏Restricted: {}
✴️Verified: {}
🤖Bot: {}
👥Groups in Common: {}
""".format(user_id, user_id, first_name, last_name, user_bio, dc_id,
           replied_user_profile_photos_count, replied_user.user.restricted,
           replied_user.user.verified, replied_user.user.bot, common_chats)
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(event.chat_id,
                            caption,
                            reply_to=message_id_to_reply,
                            parse_mode="HTML",
                            file=replied_user.profile_photo,
                            force_document=False,
                            silent=True)
    await event.delete()
Ejemplo n.º 29
0
async def _(event):
    if event.fwd_from:
        return
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    replied_user_profile_photos = await borg(
        GetUserPhotosRequest(user_id=replied_user.user.id,
                             offset=42,
                             max_id=0,
                             limit=80))
    replied_user_profile_photos_count = "NaN"
    try:
        replied_user_profile_photos_count = replied_user_profile_photos.count
    except AttributeError as e:
        pass
    user_id = replied_user.user.id
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
    if first_name is not None:
        # some weird people (like me) have more than 4096 characters in their names
        first_name = first_name.replace("\u2060", "")
    # inspired by https://telegram.dog/afsaI181
    user_bio = replied_user.about
    if user_bio is not None:
        user_bio = html.escape(replied_user.about)
    common_chats = replied_user.common_chats_count
    try:
        dc_id, location = get_input_location(replied_user.profile_photo)
    except Exception as e:
        dc_id = "Need a Profile Picture to check **this**"
        location = str(e)
    caption = """Detailed Whois:

ID🔖: <code>{}</code>
Name🤵: <a href='tg://user?id={}'>{}</a>
Bio✍️: {}
Data Centre Number🌏: {}
Number of Profile Pics🖼: {}
Restricted🔏: {}
Verified🌐: {}
Bot🤖: {}
Groups in Common👥: {}


List Of Telegram Data Centres:

DC1 : Miami FL, USA
DC2 : Amsterdam, NL
DC3 : Miami FL, USA
DC4 : Amsterdam, NL
DC5 : Singapore, SG
""".format(user_id, user_id, first_name, user_bio, dc_id,
           replied_user_profile_photos_count, replied_user.user.restricted,
           replied_user.user.verified, replied_user.user.bot, common_chats)
    message_id_to_reply = event.message.reply_to_msg_id
    if not message_id_to_reply:
        message_id_to_reply = event.message.id
    await borg.send_message(event.chat_id,
                            caption,
                            reply_to=message_id_to_reply,
                            parse_mode="HTML",
                            file=replied_user.profile_photo,
                            force_document=False,
                            silent=True)
    await event.delete()