Exemple #1
0
async def muter(moot):
    """ Used for deleting the messages of muted people """
    try:
        from FreakyUserbot.modules.sql_helper.gmute_sql import is_gmuted
        from FreakyUserbot.modules.sql_helper.spam_mute_sql import is_muted
    except AttributeError:
        return
    muted = is_muted(moot.chat_id)
    gmuted = is_gmuted(moot.sender_id)
    rights = ChatBannedRights(
        until_date=None,
        send_messages=True,
        send_media=True,
        send_stickers=True,
        send_gifs=True,
        send_games=True,
        send_inline=True,
        embed_links=True,
    )
    if muted:
        for i in muted:
            if str(i.sender) == str(moot.sender_id):
                await moot.delete()
                await moot.client(
                    EditBannedRequest(moot.chat_id, moot.sender_id, rights))
    for i in gmuted:
        if i.sender == str(moot.sender_id):
            await moot.delete()
async def handler(rkG):
    if rkG.user_joined or rkG.user_added:
        try:
            from FreakyUserbot.modules.sql_helper.gmute_sql import is_gmuted

            guser = await rkG.get_user()
            gmuted = is_gmuted(guser.id)
        except:
            return
        if gmuted:
            for i in gmuted:
                if i.sender == str(guser.id):
                    chat = await rkG.get_chat()
                    admin = chat.admin_rights
                    creator = chat.creator
                    if admin or creator:
                        try:
                            await client.edit_permissions(rkG.chat_id,
                                                          guser.id,
                                                          view_messages=False)
                            await rkG.reply(
                                f"**Gbanned User Joined!!** \n"
                                f"**Victim Id**: [{guser.id}](tg://user?id={guser.id})\n"
                                f"**Action **  : `Banned`")
                        except:
                            rkG.reply("`No Permission To Ban`")
                            return
Exemple #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 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()