Example #1
0
        await event.edit("**Making instant view...**")
        async with event.client.conversation(chat) as conv:
            try:
                response = conv.wait_event(
                    events.NewMessage(incoming=True, from_users=272572121)
                )
                await event.client.send_message(chat, url)
                response = await response
            except YouBlockedUserError:
                await event.reply("```Please unblock me (@chotamreaderbot) u N***a```")
                return
            await event.delete()
            await event.client.send_message(
                event.chat_id, response.message, reply_to=reply_message
            )


CMD_HELP.update(
    {
        "pastebin": ".paste <text/reply>\
\nUsage: Create a paste or a shortened url using dogbin (https://del.dog/)\
\n\n.getpaste\
\nUsage: Gets the content of a paste or shortened url from dogbin (https://del.dog/)\
\n\n.iffuci <text/reply>\
\nUsage: Create a paste or a shortened url using iffuci (https://www.iffuci.tk)\
\n\n.paster <text/reply>\
\nUsage: Create a instant view or a paste it in telegraph file\
  "
    }
)
Example #2
0
    if rkG.user_joined or rkG.user_added:
        try:
            from DaisyX.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


CMD_HELP.update({"gban": "gban any user using username or tag dont use id "})
Example #3
0
    final_output = "**EVAL**: `{}` \n\n **OUTPUT**: \n`{}` \n".format(cmd, evaluation)

    if len(final_output) > Config.MAX_MESSAGE_SIZE_LIMIT:
        with io.BytesIO(str.encode(final_output)) as out_file:
            out_file.name = "eval.text"
            await borg.send_file(
                event.chat_id,
                out_file,
                force_document=True,
                allow_cache=False,
                caption=cmd,
                reply_to=reply_to_id,
            )
            await event.delete()
    else:
        await eor(event, final_output)


async def aexec(code, event):
    exec(f"async def __aexec(event): " + "".join(f"\n {l}" for l in code.split("\n")))
    return await locals()["__aexec"](event)


CMD_HELP.update(
    {
        "eval": ".eval (?)\
\nUsage: this is a plug-in but abhi meko iska poora usage ni pta jaldi add krduga.\
"
    }
)
Example #4
0
                with open(downloaded_file_name, "rb") as fd:
                    m_list = fd.readlines()
                for m in m_list:
                    page_content += m.decode("UTF-8") + "\n"
                os.remove(downloaded_file_name)
            page_content = page_content.replace("\n", "<br>")
            response = telegraph.create_page(title_of_page,
                                             html_content=page_content)
            end = datetime.now()
            ms = (end - start).seconds
            await event.edit(
                "Pasted to https://telegra.ph/{} in {} seconds.".format(
                    response["path"], ms),
                link_preview=True,
            )
    else:
        await event.edit(
            "Reply to a message to get a permanent telegra.ph link. (Okay)")


def resize_image(image):
    im = Image.open(image)
    im.save(image, "PNG")


CMD_HELP.update({
    "telegraph":
    ".t(m/t)"
    "\nUsage .tm Give Telegraph Link of media nd .tt telegraph link of text ."
})
Example #5
0
            )
            response2 = conv.wait_event(
                events.NewMessage(incoming=True, from_users=461843263)
            )
            response3 = conv.wait_event(
                events.NewMessage(incoming=True, from_users=461843263)
            )
            await conv.send_message("/search_id {}".format(sender))
            response1 = await response1
            response2 = await response2
            response3 = await response3
        except YouBlockedUserError:
            await event.reply("Please unblock ( @Sangmatainfo_bot ) ")
            return
        if response1.text.startswith("No records found"):
            await event.edit("User never changed his Username...")
        else:
            await event.delete()
            await event.client.send_message(event.chat_id, response2.message)

            await event.client.send_message(event.chat_id, response3.message)


CMD_HELP.update(
    {
        "sg": "__**PLUGIN NAME :** sg__\
    \n\n📌** CMD ★** `.sg`\
    \n**USAGE   ★  **Retrieves the name and username history of the replied user even if he has forwarded message privacy..! This may not always work as perfect it should be..if doesn't then try once again.."
    }
)
Example #6
0
            pass
        load_module(shortname)
        qwe = await eor(event, f"Successfully loaded {shortname}")
    except Exception as e:
        await qwe.edit(
            f"Daisy X could not load {shortname} because of the following error.\n{str(e)}"
        )


@bot.on(admin_cmd(pattern=r"open", outgoing=True))
@bot.on(sudo_cmd(pattern=r"open"))
async def _(event):
    b = await event.client.download_media(await event.get_reply_message())
    a = open(b, "r")
    c = a.read()
    a.close()
    a = await event.reply("**Reading file...**")
    if len(c) > 4095:
        await a.edit(
            "`The Total words in this file is more than telegram limits.`")
    else:
        await event.client.send_message(event.chat_id, f"```{c}```")
        await a.delete()
    os.remove(b)


CMD_HELP.update({
    "open":
    ".open <reply to a file>\nUse - Read contents of file and send as a telegram message."
})
Example #7
0
    """For .sd command, make seflf-destructable messages."""
    message = destroy.text
    counter = int(message[4:6])
    text = str(destroy.text[6:])
    await destroy.delete()
    smsg = await destroy.client.send_message(destroy.chat_id, text)
    await sleep(counter)
    await smsg.delete()
    if BOTLOG:
        await destroy.client.send_message(BOTLOG_CHATID,
                                          "sd query done successfully")


CMD_HELP.update({
    "purge":
    ".purge\
        \nUsage: Purges all messages starting from the reply."
})

CMD_HELP.update({
    "purgeme":
    ".purgeme <x>\
        \nUsage: Deletes x amount of your latest messages."
})

CMD_HELP.update({"del": ".del\
\nUsage: Deletes the message you replied to."})

CMD_HELP.update({
    "edit":
    ".edit <newmessage>\
Example #8
0
        return
    chat = "@chotamreaderbot"
    reply_message.sender
    await event.edit("**Making instant view...**")
    async with event.client.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=272572121)
            )
            await event.client.forward_messages(chat, reply_message)
            response = await response
        except YouBlockedUserError:
            await event.reply("Please unblock me @chotamreaderbot")
            return
        await event.delete()
        await event.client.send_message(
            event.chat_id, response.message, reply_to=reply_message
        )


CMD_HELP.update(
    {
        "bots": ".purl (reply to file)\nUse - Get a direct download link of that file/doc/pic/vid\
        \n\n.reader (reply to url)\nUse - Open that url in telegraph .\
        \n\n.sgm (reply to any user or tag)\nUse - send details of that user.\
        \n\n.recognize (reply to any media)\nUse - send details about it.\
        \n\n.wspr (message) (target username/id)\nUse - Send a whisper message to that person.\
        \n\n.limits\nUse - Check if you are limited by telegram."
    }
)
Example #9
0
        userid = reply.sender_id
    elif private is True:
        userid = event.chat_id
    else:
        return await event.edit(
            "Please reply to a user or add their into the command to ungmute them."
        )
    event.chat_id
    if not is_muted(userid, "gmute"):
        return await event.edit("тнιѕ ρєяѕση ιѕ ησт gмυтє∂")
    try:
        unmute(userid, "gmute")
    except Exception as e:
        await event.edit("Error occured!\nError is " + str(e))
    else:
        await event.edit(
            "тнιѕ ρєяѕση gσт υηgмυтє∂ ѕυ¢¢єѕѕƒυℓℓу ησω нє/ѕнє ¢αη ѕρєαк ƒяєєℓу"
        )


@command(incoming=True)
async def watcher(event):
    if is_muted(event.sender_id, "gmute"):
        await event.delete()


CMD_HELP.update({
    "gmute":
    "𝚈𝙾𝚄 𝙲𝙰𝙽 𝙼𝚄𝚃𝙴 𝙿𝙴𝚁𝚂𝙸𝙾𝙽 𝙵𝚁𝙾𝙼 𝙰𝙻𝙻 𝙶𝚁𝙾𝚄𝙿 𝚆𝙷𝙴𝚁𝙴 𝚈𝙾𝚄 𝙰𝙳𝙼𝙸𝙽 𝚆𝙸𝚃𝙷 𝙳𝙴𝙻𝙴𝚃𝙴 𝙼𝙴𝚂𝚂𝙰𝙶𝙴 𝚁𝙸𝙶𝙷𝚃 𝚅𝙸𝙰 𝚃𝙷𝙸𝚂 𝙿𝙻𝚄𝙶𝙸𝙽"
})
Example #10
0
if NEEDIT == "on":

    @telebot.on(events.NewMessage(incoming=True))
    async def on_new_private_message(event):
        event.message.message
        event.message.media
        event.message.id
        event.message.to_id
        chat_id = event.chat_id
        sender = await borg.get_entity(chat_id)
        if chat_id == borg.uid:
            return
        if sender.bot:
            return
        if sender.verified:
            return
        if not pmpermit_sql.is_approved(chat_id):
            await borg(functions.contacts.BlockRequest(chat_id))


CMD_HELP.update(
    {
        "pmsecurity": ".approve/.a\nUse - Approve PM\
        \n\n.disapprove/.da\nUse - DisApprove PM\
        \n\n.listapproved\nUse - Get all approved PMs.\
        \n\nSet var PMPERMIT_PIC for custom PMPic, CUSTOM_PMPERMIT for custom text, PMSECURITY <on/off> to enable/disable, INSTANT_BLOCK <on/off>.\
        \nGet help from @DaisyXOT."
    }
)

Example #11
0
    chat = None
    if not input_str:
        chat = to_write_chat
    else:
        mentions = "Bots in {} channel: \n".format(input_str)
        try:
            chat = await borg.get_entity(input_str)
        except Exception as e:
            await event.edit(str(e))
            return None
    try:
        async for x in borg.iter_participants(chat,
                                              filter=ChannelParticipantsBots):
            if isinstance(x.participant, ChannelParticipantAdmin):
                mentions += "\n ⚜️ [{}](tg://user?id={}) `{}`".format(
                    x.first_name, x.id, x.id)
            else:
                mentions += "\n [{}](tg://user?id={}) `{}`".format(
                    x.first_name, x.id, x.id)
    except Exception as e:
        mentions += " " + str(e) + "\n"
    await event.edit(mentions)


CMD_HELP.update({
    "get_bot":
    "**Plugin : **`get_bot`\
    \n\n**Syntax : **`.get_bot`\
    \n**Function : **all bots list use .get_bot"
})
Example #12
0
                            chat_id=event.chat_id, user_id=user_id, fwd_limit=1000000
                        )
                    )
                except Exception as e:
                    await event.reply(str(e))
            await edit_or_reply(event, "Invited Successfully")
        else:
            # https://lonamiwebs.github.io/Telethon/methods/channels/invite_to_channel.html
            for user_id in to_add_users.split(" "):
                try:
                    await borg(
                        functions.channels.InviteToChannelRequest(
                            channel=event.chat_id, users=[user_id]
                        )
                    )
                except Exception as e:
                    await event.reply(str(e))
            await edit_or_reply(event, "Added user to the chat....")


CMD_HELP.update(
    {
        "invite": """**Plugin : **`invite`
  •  **Syntax : **`.invite username(s)/userid(s)`
  •  **Function : **__Add the given user/users to the group where u used the command__
  •  **Syntax : **`.inviteall groups username`
  •  **Function : **__Scrapes users from the given chat to your group__
"""
    }
)
Example #13
0
                    replied_user = await event.client(
                        GetFullUserRequest(user_id))
                    return replied_user, None
                except Exception as e:
                    return None, e
        elif event.is_private:
            try:
                user_id = event.chat_id
                replied_user = await event.client(GetFullUserRequest(user_id))
                return replied_user, None
            except Exception as e:
                return None, e
        else:
            try:
                user_object = await event.client.get_entity(int(input_str))
                user_id = user_object.id
                replied_user = await event.client(GetFullUserRequest(user_id))
                return replied_user, None
            except Exception as e:
                return None, e


CMD_HELP.update({
    "clone":
    ".clone <username/reply>\
\nUsage: steals others profile including dp, name.\
\n\n.revert\
\nUsage: To back to your profile but it'll show ALIVE_NAME instead of your current name and DEFAULT_BIO instead of your current bio\
"
})
Example #14
0
                access_hash=stickerset_attr.stickerset.access_hash,
            )))
    pack_emojis = []
    for document_sticker in get_stickerset.packs:
        if document_sticker.emoticon not in pack_emojis:
            pack_emojis.append(document_sticker.emoticon)

    OUTPUT = (f"**Sticker Title:** `{get_stickerset.set.title}\n`"
              f"**Sticker Short Name:** `{get_stickerset.set.short_name}`\n"
              f"**Official:** `{get_stickerset.set.official}`\n"
              f"**Archived:** `{get_stickerset.set.archived}`\n"
              f"**Stickers In Pack:** `{len(get_stickerset.packs)}`\n"
              f"**Emojis In Pack:**\n{' '.join(pack_emojis)}")

    await event.edit(OUTPUT)


CMD_HELP.update({
    "stickers":
    ".kang\
\nUsage: Reply .kang to a sticker or an image to kang it to your userbot pack.\
\n\n.kang [emoji('s)]\
\nUsage: Works just like .kang but uses the emoji('s) you picked.\
\n\n.kang [number]\
\nUsage: Kang's the sticker/image to the specified pack but uses 🤔 as emoji.\
\n\n.kang [emoji('s)] [number]\
\nUsage: Kang's the sticker/image to the specified pack and uses the emoji('s) you picked.\
\n\n.stkrinfo\
\nUsage: Gets info about the sticker pack."
})
Example #15
0
        reply_to_id = event.reply_to_msg_id
    cmd = "ls DaisyX/modules"
    process = await asyncio.create_subprocess_shell(
        cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
    )
    stdout, stderr = await process.communicate()
    o = stdout.decode()
    _o = o.split("\n")
    o = "\n".join(_o)
    OUTPUT = f"**List of Plugins:**\n - {o}\n\n**HELP:** __If you want to know the commands for a plugin, do:-__ \n `.help <plugin name>` **without the < > brackets.**\n__All modules might not work directly. Visit__ @DaisyXOT __for assistance.__"
    if len(OUTPUT) > 69:
        with io.BytesIO(str.encode(OUTPUT)) as out_file:
            out_file.name = "cmd_list.text"
            await bot.send_file(
                event.chat_id,
                out_file,
                force_document=True,
                allow_cache=False,
                caption=cmd,
                reply_to=reply_to_id,
            )
            await event.delete()
    await event.edit(OUTPUT)


CMD_HELP.update(
    {
        "command_list": ".cmds\nUsage - Extracts all the plugins of this DaisyX in a link.."
    }
)
Example #16
0
            photos = await event.client.get_profile_photos(user.sender)
        else:
            photos = await event.client.get_profile_photos(chat)
        if id.strip() == "":
            try:
                await event.client.send_file(event.chat_id, photos)
            except a:
                photo = await event.client.download_profile_photo(chat)
                await borg.send_file(event.chat_id, photo)
        else:
            try:
                id = int(id)
                if id <= 0:
                    await eor(event, "`ID number you entered is invalid`")
                    return
            except BaseException:
                await eor(event, "`Are you Comedy Me ?`")
                return
            if int(id) <= (len(photos)):
                send_photos = await event.client.download_media(photos[id - 1])
                await borg.send_file(event.chat_id, send_photos)
            else:
                await eor(event, "`That user has no photos 🙄`")
                return


CMD_HELP.update({
    "ppgrab":
    ".poto <a number (optional)> <reply to user>\nUse - get the persons profile pic(s)."
})
Example #17
0
                reply_to=event,
            )
            await event.delete()
    else:
        await event.edit(msg)


@borg.on(admin_cmd(pattern="search ?(.*)"))
async def search(event):
    channel_id = event.pattern_match.group(1)
    try:
        channel = await borg.get_entity(int(channel_id))
    except ValueError:
        await event.edit("Invalid id.")
    name = channel.title
    username = channel.username
    if username:
        username = "******" + username
    await event.edit(f"Name : {name}\nUsername: {username}")


CMD_HELP.update({
    "broadcast":
    ".add\nUse - Add the channel/group to your database."
    ".rmchannel (all)<channel/group id>\nUse - Remove the channel/group from database. Use rm all to remove all groups."
    ".broadcast <reply to message>\nUse - Send the message to all channels/groups in the db."
    ".forward <reply to polls/stickers>\nUse - Forwards the poll/sticker to all channels/groups in db."
    ".listchannels\nUse - List all added channels."
    ".search <channel id>\nUse - Search for the channel name from id."
})
Example #18
0
        name = item["name"]
        dl_url = item["url"]
        reply += f"[{name}]({dl_url}) "
    return reply


def useragent():
    """
    useragent random setter
    """
    useragents = BeautifulSoup(
        requests.get(
            "https://developers.whatismybrowser.com/"
            "useragents/explore/operating_system_name/android/").content,
        "lxml",
    ).findAll("td", {"class": "useragent"})
    user_agent = choice(useragents)
    return user_agent.text


CMD_HELP.update({
    "direct_links":
    "**Plugin : **`direct`\
        \n\n**Syntax : **`.direct <url>`\n"
    "**Function : **Reply to a link or paste a URL to\n"
    "generate a direct download link\n\n"
    "List of supported URLs:\n"
    "`Google Drive - Cloud Mail - Yandex.Disk - AFH - "
    "ZippyShare - MediaFire - SourceForge - OSDN - GitHub`"
})
Example #19
0
import asyncio
import os

from DaisyX import CMD_HELP
from DaisyX.utils import admin_cmd, sudo_cmd


@bot.on(admin_cmd(pattern="repack ?(.*)", outgoing=True))
@bot.on(sudo_cmd(pattern="repack ?(.*)", allow_sudo=True))
async def _(event):
    a = await event.get_reply_message()
    input_str = event.pattern_match.group(1)
    b = open(input_str, "w")
    b.write(str(a.message))
    b.close()
    a = await event.reply(f"Packing into {input_str}")
    await asyncio.sleep(2)
    await a.edit(f"Uploading {input_str}")
    await asyncio.sleep(2)
    await event.client.send_file(event.chat_id, input_str)
    await a.delete()
    os.remove(input_str)


CMD_HELP.update({
    "repack":
    ".repack <filename.extension> <reply to text>\nUse - Pack the text and send as a file."
})
Example #20
0
    return user_obj


CMD_HELP.update({
    "admin":
    ".promote <username/reply> <custom rank (optional)>\
\nUsage: Provides admin rights to the person in the chat.\
\n\n.demote <username/reply>\
\nUsage: Revokes the person's admin permissions in the chat.\
\n\n.ban <username/reply> <reason (optional)>\
\nUsage: Bans the person off your chat.\
\n\n.unban <username/reply>\
\nUsage: Removes the ban from the person in the chat.\
\n\n.mute <username/reply> <reason (optional)>\
\nUsage: Mutes the person in the chat, works on admins too.\
\n\n.unmute <username/reply>\
\nUsage: Removes the person from the muted list.\
\n\n.gmute <username/reply> <reason (optional)>\
\nUsage: Mutes the person in all groups you have in common with them.\
\n\n.ungmute <username/reply>\
\nUsage: Reply someone's message with .ungmute to remove them from the gmuted list.\
\n\n.delusers\
\nUsage: Searches for deleted accounts in a group. Use .delusers clean to remove deleted accounts from the group.\
\n\n.adminlist\
\nUsage: Retrieves a list of admins in the chat.\
\n\n.users or .users <name of member>\
\nUsage: Retrieves all (or queried) users in the chat.\
\n\n.setgppic <reply to image>\
\nUsage: Changes the group's display picture."
})
Example #21
0

def get_lst_of_files(input_directory, output_lst):
    filesinfolder = os.listdir(input_directory)
    for file_name in filesinfolder:
        current_file_name = os.path.join(input_directory, file_name)
        if os.path.isdir(current_file_name):
            return get_lst_of_files(current_file_name, output_lst)
        output_lst.append(current_file_name)
    return output_lst


CMD_HELP.update({
    "archive":
    ".zip reply to a file/media\
    \nUSEAGE: it will zip that file/media\
    \n\n.rar reply to a file/media\
    \nUSEAGE: it will rar that file/media\
    z\n\n. reply to a file/media\
    \nUSEAGE: it will make into .7z that hat file/media\
    \n\n.tar reply to a file/media\
    \nUSEAGE: it will tar that file/media\
    \n\n.unzip reply to a .zip file\
    \nUSEAGE: it will unzip that .zip file\
    \n\n.unrar reply to a .rar file\
    \nUSEAGE: it will unrar that .rar file\
    \n\n.untar reply to a .tar\
    \nUSEAGE: it will untar that .tar file\
"
})
Example #22
0
                    (i_height - u_height - int((20 / 640) * i_width)) + 2,
                ),
                text=l_text,
                font=m_font,
                fill=(0, 0, 0),
            )

            draw.text(
                xy=(
                    (i_width - u_width) / 2,
                    i_height - u_height - int((20 / 640) * i_width),
                ),
                text=l_text,
                font=m_font,
                fill=(255, 255, 255),
            )
            current_h += u_height + pad
    image_name = "memify.webp"
    webp_file = os.path.join(Var.TEMP_DOWNLOAD_DIRECTORY, image_name)
    img.save(webp_file, "webp")
    return webp_file


CMD_HELP.update(
    {
        "memify": ".memify (text)\
\nUsage: print your text on photo or sticker.\
"
    }
)
Example #23
0
    await dyno.client.send_file(
        dyno.chat_id,
        "logs.txt",
        reply_to=dyno.id,
        caption="ᴅᴀɪsʏ x 𝙻𝙾𝙶𝚂 𝚘𝙵 100+ lines",
    )

    await asyncio.sleep(5)
    await dyno.delete()
    return os.remove("logs.txt")


def prettyjson(obj, indent=2, maxlinelength=80):
    """Renders JSON content with indentation and line splits/concatenations to fit maxlinelength.
    Only dicts, lists and basic types are supported"""

    items, _ = getsubitems(
        obj,
        itemkey="",
        islast=True,
        maxlinelength=maxlinelength - indent,
        indent=indent,
    )
    return indentitems(items, indent, level=0)


CMD_HELP.update({
    "heroku":
    "Info for Module to Manage Heroku:**\n\n`.usage`\nUsage:__Check your heroku dyno hours status.__\n\n`.set var <NEW VAR> <VALUE>`\nUsage: __add new variable or update existing value variable__\n**!!! WARNING !!!, after setting a variable the bot will restart.**\n\n`.get var or .get var <VAR>`\nUsage: __get your existing varibles, use it only on your private group!__\n**This returns all of your private information, please be cautious...**\n\n`.del var <VAR>`\nUsage: __delete existing variable__\n**!!! WARNING !!!, after deleting variable the bot will restarted**\n\n`.herokulogs`\nUsage:sends you recent 100 lines of logs in heroku"
})
Example #24
0
                else:
                    mentions += f"\nDeleted Account `{user.id}`"
    except ChatAdminRequiredError as err:
        mentions += " " + str(err) + "\n"
    try:
        await show.edit(mentions)
    except MessageTooLongError:
        await show.edit(
            "Damn, this is a huge group. Uploading users lists as file.")
        file = open("userslist.txt", "w+")
        file.write(mentions)
        file.close()
        await show.client.send_file(
            show.chat_id,
            "userslist.txt",
            caption="Users in {}".format(title),
            reply_to=show.id,
        )
        remove("userslist.txt")


CMD_HELP.update({
    "chatinfo":
    ".chatinfo or .chatinfo <username of group>\
     \nUsage: Shows you the total information of the required chat.\
     \n\n.adminlist\
     \nUsage: Retrieves a list of admins in the chat.\
     \n\n.users or .users <name of member>\
     \nUsage: Retrieves all (or queried) users in the chat."
})
Example #25
0
    response += f"**┣** ᪥ **Aᴅᴍɪɴ ʀɪɢʜᴛs:** `{admin_in_broadcast_channels - creator_in_channels}` ᪥\n**┗━━━━━━━━━━━━━━━━━━━━━**\n**┏━━━━━━━━━━━━━━━━━━━━━**\n"
    response += f"**┣** ᪥ **Uɴʀᴇᴀᴅ ᴍᴇssᴀɢᴇs:** `{unread}` ᪥\n"
    response += f"**┣** ᪥ **Uɴʀᴇᴀᴅ ᴍᴇɴᴛɪᴏɴs:** `{unread_mentions}` ᪥\n**┗━━━━━━━━━━━━━━━━━━━━━**\n"
    response += f"📌 **Fʀᴏᴍ ᴛʜᴇ ᴅᴀᴛᴀ ʙᴀsᴇ ᴏғ [ᴅᴀɪsʏ X](http://github.com/TeamDaisyX/Daisy-X-UB)** 📌"
    await alain.edit(response)


def make_mention(user):
    if user.username:
        return f"@{user.username}"
    return inline_mention(user)


def inline_mention(user):
    full_name = user_full_name(user) or "No Name"
    return f"[{full_name}](tg://user?id={user.id})"


def user_full_name(user):
    names = [user.first_name, user.last_name]
    names = [i for i in list(names) if i]
    return " ".join(names)


CMD_HELP.update({
    "stat":
    "**Plugin : **`stat`\
    \n\n**Syntax : **`.stat`\
    \n**Function : **Shows you the count of  your groups, channels, private chats...etc"
})
Example #26
0
        await rose.send_message("/myfeds")
        pro = await rose.get_response()
        if "Looks like" in pro.text:
            await pro.click(0)
            await asyncio.sleep(1.5)
            pro = await rose.get_response()
            await borg.send_file(
                event.chat_id, pro, caption="**Cʜᴇᴄᴋᴇᴅ ʙʏ 𝙳𝙰𝙸𝚂𝚈X ฅ^•ﻌ•^ฅ**"
            )
        else:
            await LEGENDX.edit(pro.text + "\n\n**Cʜᴇᴄᴋᴇᴅ 𝚋𝚢 𝙳𝙰𝙸𝚂𝚈X ฅ^•ﻌ•^ฅ**")


CMD_HELP.update(
    {
        "RoseFedStuff": ".fstat <username/userid/reply to user>\nUse - To check the persons fedban stat in @MissRose_Bot.\
        \n\n.fedinfo <fedid>\nUse - To see info about the fed."
    }
)


import asyncio

from telethon.errors.rpcerrorlist import YouBlockedUserError

from Assist.DAISYX import NAME
from DaisyX import CMD_HELP, bot
from DaisyX.utils import admin_cmd

DaisyX = "@DaisyXBot"
DEVIL = NAME
Example #27
0
    else:
        OUT_STR = "No Blacklists found. Start saving using `.addblacklist`"
    if len(OUT_STR) > Config.MAX_MESSAGE_SIZE_LIMIT:
        with io.BytesIO(str.encode(OUT_STR)) as out_file:
            out_file.name = "blacklist.text"
            await event.client.send_file(
                event.chat_id,
                out_file,
                force_document=True,
                allow_cache=False,
                caption="Blacklists in the Current Chat",
                reply_to=event,
            )
            await event.delete()
    else:
        await edit_or_reply(event, OUT_STR)


CMD_HELP.update({
    "blacklist":
    "**blacklist**\
    \n**Syntax : **`.addblacklist` <word/words>\
    \n**Usage : **The given word or words will be added to blacklist in that specific chat if any user sends then the message gets deleted.\
    \n\n**Syntax : **`.rmblacklist` <word/words>\
    \n**Usage : **The given word or words will be removed from blacklist in that specific chat\
    \n\n**Syntax : **`.listblacklist`\
    \n**Usage : **Shows you the list of blacklist words in that specific chat\
    \n\n**Note : **if you are adding more than one word at time via this, then remember that new word must be given in a new line that is not [hi hello]. It must be as\
    \n[hi \n hello]"
})
Example #28
0
        KeyValueItem("restricted", Code(user.restricted)),
        KeyValueItem("restriction_reason", Code(user.restriction_reason)),
        KeyValueItem("deleted", Code(user.deleted)),
        KeyValueItem("verified", Code(user.verified)),
        KeyValueItem("min", Code(user.min)),
        KeyValueItem("lang_code", Code(user.lang_code)),
    )

    return Section(
        title,
        general if show_general else None,
        misc if show_misc else None,
        bot if show_bot else None,
    )


CMD_HELP.update({
    "android":
    "`.u(ser) [options] (username|id)`"
    "Or, in response to a message"
    "`.u(ser) [options]`"
    "Options:"
    "`.id`: Show only the user's ID"
    "`.general`: Show general user info"
    "`.bot`: Show bot related info"
    "`.misc`: Show miscelanious info"
    "`.all`: Show all info (overrides other options)"
    "`.mention`: Inline mention the user"
    "`.forward`: Follow forwarded message"
})
Example #29
0
@bot.on(admin_cmd(pattern="meaning (.*)"))
@bot.on(sudo_cmd(pattern="meaning (.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    word = event.pattern_match.group(1)
    dictionary = PyDictionary()
    hell = dictionary.meaning(word)
    output = f"**Word :** __{word}__\n\n"
    try:
        for a, b in hell.items():
            output += f"**{a}**\n"
            for i in b:
                output += f"☞__{i}__\n"
        await edit_or_reply(event, output)
    except Exception:
        await edit_or_reply(event, f"Couldn't fetch meaning of {word}")


CMD_HELP.update(
    {
        "dictionary": "**Plugin :** `dictionary`\
    \n\n**Syntax :** `.ud query`\
    \n**Usage : **fetches meaning from Urban dictionary\
    \n\n**Syntax : **`.meaning query`\
    \n**Usage : **Fetches meaning of the given word\
    "
    }
)
Example #30
0
                    user_object = await event.client.get_entity(input_str)
                    user_id = user_object.id
                    replied_user = await event.client(
                        GetFullUserRequest(user_id))
                    return replied_user, None
                except Exception as e:
                    return None, e
        elif event.is_private:
            try:
                user_id = event.chat_id
                replied_user = await event.client(GetFullUserRequest(user_id))
                return replied_user, None
            except Exception as e:
                return None, e
        else:
            try:
                user_object = await event.client.get_entity(int(input_str))
                user_id = user_object.id
                replied_user = await event.client(GetFullUserRequest(user_id))
                return replied_user, None
            except Exception as e:
                return None, e


CMD_HELP.update({
    "information":
    "**Plugin : **`information`\
    \n\n**Syntax : **`.info`\
    \n**Function : **info any user tag any type .info see details of user"
})