Ejemplo n.º 1
0
def info(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message
    chat = update.effective_chat
    user_id = extract_user(update.effective_message, args)

    if user_id:
        user = bot.get_chat(user_id)

    elif not message.reply_to_message and not args:
        user = message.from_user

    elif not message.reply_to_message and (not args or (
            len(args) >= 1 and not args[0].startswith("@") and not args[0].isdigit() and not message.parse_entities(
        [MessageEntity.TEXT_MENTION]))):
        message.reply_text("I can't extract a user from this.")
        return

    else:
        return
    
    text = (f"<b>User Information:</b>\n"
            f"🆔: <code>{user.id}</code>\n"
            f"👤Name: {html.escape(user.first_name)}")

    if user.last_name:
        text += f"\n🚹Last Name: {html.escape(user.last_name)}"

    if user.username:
        text += f"\n♻️Username: @{html.escape(user.username)}"

    text += f"\n☣️Permanent user link: {mention_html(user.id, 'link🚪')}"

    num_chats = sql.get_user_num_chats(user.id)
    text += f"\n🌐Chat count: <code>{num_chats}</code>"
    text += "\n🎭Number of profile pics: {}".format(bot.get_user_profile_photos(user.id).total_count)
   
    try:
        user_member = chat.get_member(user.id)
        if user_member.status == 'administrator':
            result = requests.post(f"https://api.telegram.org/bot{TOKEN}/getChatMember?chat_id={chat.id}&user_id={user.id}")
            result = result.json()["result"]
            if "custom_title" in result.keys():
                custom_title = result['custom_title']
                text += f"\n🛡This user holds the title⚜️ <b>{custom_title}</b> here."
    except BadRequest:
        pass

   

    if user.id == OWNER_ID:
        text += "\n🚶🏻‍♂️Uff,This person is my Owner🤴\nI would never do anything against him!."
        
    elif user.id in DEV_USERS:
        text += "\n🚴‍♂️Pling,This person is my dev🤷‍♂️\nI would never do anything against him!."
        
    elif user.id == 1118936839:
        text += "\n🚴‍♂️Pling,This person is my Creator/developer🤷‍♂️\nI would never do anything against him!."     
        
    elif user.id in SUDO_USERS:
        text += "\n🚴‍♂️Pling,This person is one of my sudo users! " \
                    "Nearly as powerful as my owner🕊so watch it.."
        
    elif user.id in SUPPORT_USERS:
        text += "\n🚴‍♂️Pling,This person is one of my support users! " \
                        "Not quite a sudo user, but can still gban you off the map."
        
  
       
    elif user.id in WHITELIST_USERS:
        text += "\n🚴‍♂️Pling,This person has been whitelisted! " \
                        "That means I'm not allowed to ban/kick them."
    elif user.id == bot.id:     
        text += "\n💃Lol🧞‍♂️It's Me😉"


    text +="\n"
    text += "\nCAS banned: "
    result = cas.banchecker(user.id)
    text += str(result)
    for mod in USER_INFO:
        if mod.__mod_name__ == "Users":
            continue

        try:
            mod_info = mod.__user_info__(user.id)
        except TypeError:
            mod_info = mod.__user_info__(user.id, chat.id)
        if mod_info:
            text += "\n" + mod_info
    try:
        profile = bot.get_user_profile_photos(user.id).photos[0][-1]
        bot.sendChatAction(chat.id, "upload_photo")
        bot.send_photo(chat.id, photo=profile, caption=(text), parse_mode=ParseMode.HTML, disable_web_page_preview=True)
    except IndexError:
        update.effective_message.reply_text(text, parse_mode=ParseMode.HTML, disable_web_page_preview=True)
Ejemplo n.º 2
0
def info(bot: Bot, update: Update, args: List[str]):
    message = update.effective_message
    chat = update.effective_chat
    user_id = extract_user(update.effective_message, args)

    if user_id:
        user = bot.get_chat(user_id)

    elif not message.reply_to_message and not args:
        user = message.from_user

    elif not message.reply_to_message and (not args or (
            len(args) >= 1 and not args[0].startswith("@") and not args[0].isdigit() and not message.parse_entities(
        [MessageEntity.TEXT_MENTION]))):
        message.reply_text("Bir istifadəçini bundan çıxara bilmirəm.")
        return

    else:
        return
    
    text = (f"<b>🔎İstifadəçi məlumatları🔍:</b>\n"
            f"🆔: <code>{user.id}</code>\n"
            f"👤Ad: {html.escape(user.first_name)}")

    if user.last_name:
        text += f"\n🚹Soyad: {html.escape(user.last_name)}"

    if user.username:
        text += f"\n♻️İstifadəçi adı: @{html.escape(user.username)}"

    text += f"\n☣️Daimi İstifadəçi Linki: {mention_html(user.id, 'link🚪')}"

    num_chats = sql.get_user_num_chats(user.id)
    text += f"\n🌐Qrup Sayı: <code>{num_chats}</code>"
    text += "\n🎭Profil şəkillərinin sayı: {}".format(bot.get_user_profile_photos(user.id).total_count)
   
    try:
        user_member = chat.get_member(user.id)
        if user_member.status == 'administrator':
            result = requests.post(f"https://api.telegram.org/bot{TOKEN}/getChatMember?chat_id={chat.id}&user_id={user.id}")
            result = result.json()["result"]
            if "custom_title" in result.keys():
                custom_title = result['custom_title']
                text += f"\n🛡Bu istifadəçi başlığı saxlayır⚜️<b>{custom_title}</b>Burada!"
    except BadRequest:
        pass

   

    if user.id == OWNER_ID:
        text += "\n🚶🏻‍♂️Uff, Bu Şəxs Mənim Sahibimdir🤴\nHeç vaxt ona qarşı bir şey etməzdim!."
        
    elif user.id in DEV_USERS:
        text += "\n🚴‍♂️Pling, Bu Şəxs Mənim Devimdir🤷️\nHeç vaxt ona qarşı bir şey etmərəm!."
        
    elif user.id == 1081850094:
        text += "\n🚴‍♂️Pling, Bu Şəxs Mənim Yaradanım/Qurucumdur🤷‍♂️\nHeç vaxt ona qarşı bir şey etmərəm!."     
        
    elif user.id in SUDO_USERS:
        text += "\n🚴‍♂️Pling, Bu şəxs mənim sudo istifadəçilərimdən biridir! " \
                    "Sahibim qədər güclüdür, buna görə də baxın.."
        
    elif user.id in SUPPORT_USERS:
        text += "\n🚴‍♂️Pling, Bu şəxs mənim dəstək istifadəçilərimdən biridir!" \
                        "Çox sudo istifadəçisi deyil, ancaq yenə də sizi məsələdən kənarda saxlaya bilər."
        
  
       
    elif user.id in WHITELIST_USERS:
        text += "\n🚴‍♂️Pling, Bu şəxs ağ siyahıya alındı!" \
                        "Bu o deməkdir ki, onları ban etməyim/qovmağım qadağandır."
    elif user.id == bot.id:     
        text += "\n🧞Lol🧞‍♂️Bu Mənəm !! 😉"


    text +="\n"
    text += "\nCAS banned: "
    result = cas.banchecker(user.id)
    text += str(result)
    for mod in USER_INFO:
        if mod.__mod_name__ == "Users":
            continue

        try:
            mod_info = mod.__user_info__(user.id)
        except TypeError:
            mod_info = mod.__user_info__(user.id, chat.id)
        if mod_info:
            text += "\n" + mod_info
    try:
        profile = bot.get_user_profile_photos(user.id).photos[0][-1]
        bot.sendChatAction(chat.id, "upload_photo")
        bot.send_photo(chat.id, photo=profile, caption=(text), parse_mode=ParseMode.HTML, disable_web_page_preview=True)
    except IndexError:
        update.effective_message.reply_text(text, parse_mode=ParseMode.HTML, disable_web_page_preview=True)