Exemple #1
0
        )
    else:
        await eor(event, "something is wrong. please try again later.")


@mlobot.on(admin_cmd(pattern="ggl (.*)"))
@mlobot.on(sudo_cmd(pattern="ggl (.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    sample_url = "https://da.gd/s?url=https://lmgtfy.com/?q={}%26iie=1".format(
        input_str.replace(" ", "+"))
    response_api = requests.get(sample_url).text
    if response_api:
        await eor(
            event,
            "[{}]({})\n`Thank me Later 🙃` ".format(input_str,
                                                      response_api.rstrip()),
        )
    else:
        await eor(event, "something is wrong. please try again later.")


CMD_HELP.update({
    "search":
    ".gs <query>\nUse - Google the query.\
        \n\n.duckduckgo <query>\nUse - Search on DuckDuckGo\
        \n\n.ggl <query>\nUse - Learn to search, lol."
})
Exemple #2
0
    try:
        user_obj = await event.client.get_entity(user)
    except (TypeError, ValueError) as err:
        await eor(event, str(err))
        return None

    return user_obj


CMD_HELP.update({
    "admin":
    ".promote <username/reply> <custom rank (optional)>\
\nUse - : Provides admin rights to the person in the chat.\
\n\n.demote <username/reply>\
\nUse - : Revokes the person's admin permissions in the chat.\
\n\n.ban <username/reply> <reason (optional)>\
\nUse - : Bans the person off your chat.\
\n\n.unban <username/reply>\
\nUse - : Removes the ban from the person in the chat.\
\n\n.mute <username/reply> <reason (optional)>\
\nUse - : Mutes the person in the chat, works on admins too.\
\n\n.unmute <username/reply>\
\nUse - : Removes the person from the muted list.\
\n\n.admins\
\nUse - : Retrieves a list of admins in the chat.\
\n\n.users or .users <name of member>\
\nUse - : Retrieves all (or queried) users in the chat.\
\n\n.setgppic <reply to image>\
\nUse - : Changes the group's display picture."
})
Exemple #3
0
from telethon.tl.types import ChannelParticipantsAdmins
from uniborg.util import admin_cmd

from mlobot import CMD_HELP


@mlobot.on(admin_cmd(pattern="gaali"))
async def _(event):
    if event.fwd_from:
        return
    mentions = "Madarchod Randi ke bacche Oye bosdike madarchod bhen ke lode tere gand me lohe ka danda garam karke dalu randwe tujhetho gali ke kutte gand pe chut rakh ke katenge me bata raha hu tere lode pe madhu makkhi Katelode ke ando pe Road roller chale tu kab bathroom me muthne Jaye tho Tera loda ghir Jaye fir tere ando me se lizard ke bacche nikle teko kidnap Kare aur childporn banaye maa ke chuttad ke lode tere saat Johnny sins rape Kare aur jab wo teko anal de tab loda andar fas Jaye bkl tere jhaat pe waxing karunga me dhek lio fir jab tu chillayega na tab tere muh me Mai gai ka gobar dalunga sale tere gand ke balo pe tel laga ke jala du me teko Anaconda leke gand me dalu tho muh se nikle maa ke lode hamesha chutiyo jaisa bartav kartha he tu maa ke Dai chawal drugs tere gand Me dalunga thi tatti nahi nikle maa darchod kabhi teko Marne ka mouka mil gaya na tho bas I'll do my best to get that tatti outof you aur tere jaise chutio ko is duniya me jagaha bhi nahi maa ke lode bandarchod tere gand me chitiya Kate wo bhi bullet ants maadarchod samj nahi aaraha tere baap NE teko kya khake paida kiya Tha kesa chutiya he tu rand ke bacche teko shadi me khana khane na mile teko gand pe 4 thappad mare sab log aur blade se likhe I want anal madarchod bosdike maccharki tatte ke baal chutiye maa ke chut pe ghode ka Lund tere gand me jaltha hu koila Dale bhen ke lode MAA KI CHUT MAI TALWAR DUNGA BC CHUT FAT JAEGI AUR USME SE ITNA KHOON NIKLEGA MZA AJAEGA DEKHNE KA SALE MAA KE BHOSDE SE BAHR AJA FIR BAAP SE ZUBAN DA TERI MAA KI CHUT CHOD CHOD KE BHOSDABNADU MADARCHOD AUR USKE UPAR CENENT LAGADU KI TERE JESA GANDU INSAAN KABHI BAHR NA A SKE ESI GANDI CHUT MAI SE LODA LASUN MADRCHOD TERI MAA KI CHUT GASTI AMA KA CHUTIA BACHA TERI MAA KO CHOD CHOD K PAGAL KAR DUNGA MAA K LODY KISI SASTIII RANDII K BACHY TERI MAA KI CHOOT MAIN TEER MAARUN GANDU HARAMI TERI COLLEGE JATI BAJI KA ROAD PEY RAPE KARONGANDU KI OLAAD HARAM KI NASAL PAPA HUN TERA BHEN PESH KAR AB PAPA KO TERI MAA KKALE KUSS MAIN KISI !"
    chat = await event.get_input_chat()
    async for x in borg.iter_participants(chat,
                                          filter=ChannelParticipantsAdmins):
        mentions += f""
    reply_message = None
    if event.reply_to_msg_id:
        reply_message = await event.get_reply_message()
        await reply_message.reply(mentions)
    else:
        await event.reply(mentions)
    await event.delete()


CMD_HELP.update({"gaali": ".gaali\nUse - Long abuse, in hindi."})
Exemple #4
0
            m_list = None
            with open(downloaded_file_name, "rb") as fd:
                m_list = fd.readlines()
            message = ""
            for m in m_list:
                message += m.decode("UTF-8") + "\r\n"
            os.remove(downloaded_file_name)
        else:
            message = previous_message.message
    else:
        message = "SYNTAX: `.paste <long text to include>`"
    url = "https://del.dog/documents"
    r = requests.post(url, data=message.encode("UTF-8")).json()
    url = f"https://del.dog/{r['key']}"
    end = datetime.now()
    ms = (end - start).seconds
    if r["isUrl"]:
        nurl = f"https://del.dog/v/{r['key']}"
        await eor(
            event,
            "Dogged to [dogbin]({}) in {} seconds. GoTo Original URL: {}".
            format(url, ms, nurl),
        )
    else:
        await eor(event,
                  "Dogged to [dogbin]({}) in {} seconds".format(url, ms))


CMD_HELP.update(
    {"pastebin": ".paste <long text/file/reply>\nUse - Paste it to pastebin."})
Exemple #5
0
        await event.edit(input_str)

        animation_chars = [
            "⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/xditya/TeleBot/)⬜",
            "⬛⬜⬜⬜⬜\n👇⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/xditya/TeleBot/)⬜",
            "⬛⬛⬜⬜⬜\n⬜👇⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/xditya/TeleBot/)⬜",
            "⬛⬛⬛⬜⬜\n⬜⬜👇⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/xditya/TeleBot/)⬜",
            "⬛⬛⬛⬛⬜\n⬜⬜⬜👇⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/xditya/TeleBot/)⬜",
            "⬛⬛⬛⬛⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜👇⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜[🎁](https://github.com/xditya/TeleBot/)⬜",
            "⬛⬛⬛⬛⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜👇⬜\n⬜⬜⬜[🎁](https://github.com/xditya/TeleBot/)⬜",
            "⬛⬛⬛⬛⬜\n⬜⬜⬜⬛⬜\n⬜⬜⬜👇⬜\n⬜⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜\n⬜⬜⬜⬜⬜",
            "⬛⬛⬛⬛⬜\n⬜⬜⬜👇⬜\n⬜⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜",
            "⬛⬛⬛⬜⬜\n⬜⬜👇⬜⬜\n⬜⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜",
            "⬛⬛⬜⬜⬜\n⬜👇⬜⬜⬜\n⬜[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜",
            "⬛⬜⬜⬜⬜\n👇⬜⬜⬜⬜\n[🎁](https://github.com/Dark-Princ3/X-tra-Telegram/)⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜",
            "⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜\n⬜⬜⬜⬜⬜",
            "⬜⬜⬜⬜\n⬜⬜⬜⬜\n⬜⬜⬜⬜\n⬜⬜⬜⬜",
            "⬜⬜⬜\n⬜⬜⬜\n⬜⬜⬜",
            "⬜⬜\n⬜⬜",
            "[🎁](https://github.com/xditya/TeleBot/)",
        ]

        for i in animation_ttl:

            await asyncio.sleep(animation_interval)

            await event.edit(animation_chars[i % 17])


CMD_HELP.update({"lucky": ".lucky\nUse - None."})
Exemple #6
0
    """ For .google command, do a Google search. """
    match = q_event.pattern_match.group(1)
    tele = await eor(q_event, "Searching for `{}`".format(match))
    page = findall(r"page=\d+", match)
    try:
        page = page[0]
        page = page.replace("page=", "")
        match = match.replace("page=" + page[0], "")
    except IndexError:
        page = 1
    search_args = (str(match), int(page))
    gsearch = GoogleSearch()
    gresults = await gsearch.async_search(*search_args)
    res = ""
    for i in range(len(gresults["links"])):
        try:
            teletitle = gresults["titles"][i]
            telelink = gresults["links"][i]
            teledescrp = gresults["descriptions"][i]
            res += f"[{teletitle}]({telelink})\n`{teledescrp}`\n\n"
        except IndexError:
            break
    await tele.edit(
        "**GᴏᴏɢʟᴇSᴇᴀʀᴄʜ**\n__Qᴜᴇʀʏ:__\n `{}` \n\n**Rᴇsᴜʟᴛs:**\n {}".format(
            match, res),
        link_preview=False,
    )


CMD_HELP.update({"google": ".go <query>\nUse - Search the query on Google"})
Exemple #7
0
    return results


async def scam(results, lim):

    single = opener.open(results["similar_images"]).read()
    decoded = single.decode("utf-8")

    imglinks = []
    counter = 0

    pattern = r"^,\[\"(.*[.png|.jpg|.jpeg])\",[0-9]+,[0-9]+\]$"
    oboi = re.findall(pattern, decoded, re.I | re.M)

    for imglink in oboi:
        counter += 1
        if not counter >= int(lim):
            imglinks.append(imglink)
        else:
            break

    return imglinks


CMD_HELP.update({
    "reverse":
    ".reverse\
        \nUsage: Reply to a pic/sticker to reverse-search it on Google Images !!"
})
Exemple #8
0
    reply_message = await event.get_reply_message()
    if not reply_message.text:
        await eor(event, "```Reply to text message```")
        return
    chat = "@QuotLyBot"
    reply_message.sender
    if reply_message.sender.bot:
        await eor(event, "```Reply to actual users message.```")
        return
    await eor(event, "```Making a Quote```")
    async with event.client.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=1031952739))
            await event.client.forward_messages(chat, reply_message)
            response = await response
        except YouBlockedUserError:
            await event.reply("```Please unblock me (@QuotLyBot) u N***a```")
            return
        if response.text.startswith("Hi!"):
            await eor(
                event,
                "```Can you kindly disable your forward privacy settings for good?```",
            )
        else:
            await event.delete()
            await event.client.send_message(event.chat_id, response.message)


CMD_HELP.update({"quotly": ".qbot <reply to message>\nUse - To make a quote."})
Exemple #9
0
                        pip.chat_id,
                        "output.txt",
                        reply_to=pip.id,
                    )
                    remove("output.txt")
                    return
                await pip.edit(
                    "**Query: **\n`"
                    f"pip3 search {pipmodule}"
                    "`\n**Result: **\n`"
                    f"{pipout}"
                    "`"
                )
            else:
                await pip.edit(
                    "**Query: **\n`"
                    f"pip3 search {pipmodule}"
                    "`\n**Result: **\n`No Result Returned/False`"
                )
        else:
            await pip.edit("`Use .help pip to see an example`")


CMD_HELP.update(
    {
        "system": "➟ .sysd\nUsage: Shows system information using neofetch.\
        \n\n➟ .version\nUsage: Shows the userbot version.\
        \n\n➟ .pip <module(s)>\nUsage: Does a search of pip modules(s)."
    }
)
Exemple #10
0
        await ok.edit("Reply to actual users message and not a bots...")
        return
    async with event.client.conversation(chat) as conv:
        try:
            response1 = conv.wait_event(
                events.NewMessage(incoming=True, from_users=461843263))
            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 ok.edit("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 mlobot.send_message(event.chat_id, response2.message)

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


CMD_HELP.update({
    "sangmata":
    ".sg <reply to user>\nUse - Get full name and username history of the person."
})
Exemple #11
0
        name = b["name"]
        company = b["company"]
        blog = b["blog"]
        location = b["location"]
        bio = b["bio"]
        created_at = b["created_at"]
        await borg.send_file(
            event.chat_id,
            caption="""Name: [{}]({})
Type: {}
Company: {}
Blog: {}
Location: {}
Bio: {}
Profile Created: {}""".format(name, html_url, gh_type, company, blog, location,
                              bio, created_at),
            file=avatar_url,
            force_document=False,
            allow_cache=False,
            reply_to=event,
        )
        await event.delete()
    else:
        await eor(event, "`{}`: {}".format(input_str, r.text))


CMD_HELP.update({
    "github":
    ".github <username>\nUse - Get info of that user's github profile."
})
Exemple #12
0
import asyncio

from mlobot import CMD_HELP


@mlobot.on(admin_cmd(pattern="(.*)"))
async def _(event):
    if event.fwd_from:
        return
    animation_interval = 0.3
    animation_ttl = range(0, 5)
    input_str = event.pattern_match.group(1)
    if input_str == "wtf":
        await event.edit(input_str)
        animation_chars = [
            "What",
            "What The",
            "What The F",
            "What The F Brah",
            "[What The F Brah](https://telegra.ph//file/f3b760e4a99340d331f9b.jpg)",
        ]

        for i in animation_ttl:

            await asyncio.sleep(animation_interval)
            await event.edit(animation_chars[i % 5])


CMD_HELP.update(
    {"wtf": ".wtf\nUse - Animation Plugin to spam the chat recents lel"})
Exemple #13
0
@mlobot.on(admin_cmd(pattern="bigoof"))
@mlobot.on(sudo_cmd(pattern="bigoof"))
async def _(event):
    if event.fwd_from:
        return
    animation_interval = 0.1
    animation_ttl = range(0, 36)
    # input_str = event.pattern_match.group(1)
    # if input_str == "nope":
    await eor(
        event,
        "┏━━━┓╋╋╋╋┏━━━┓ \n┃┏━┓┃╋╋╋╋┃┏━┓┃ \n┃┃╋┃┣┓┏┓┏┫┃╋┃┃ \n┃┃╋┃┃┗┛┗┛┃┃╋┃┃ \n┃┗━┛┣┓┏┓┏┫┗━┛┃ \n┗━━━┛┗┛┗┛┗━━━┛",
    )
    animation_chars = [
        "╭━━━╮╱╱╱╭━╮ \n┃╭━╮┃╱╱╱┃╭╯ \n┃┃╱┃┣━━┳╯╰╮ \n┃┃╱┃┃╭╮┣╮╭╯ \n┃╰━╯┃╰╯┃┃┃ \n╰━━━┻━━╯╰╯ ",
        "╭━━━╮╱╱╱╱╱╱╭━╮ \n┃╭━╮┃╱╱╱╱╱╱┃╭╯ \n┃┃╱┃┣━━┳━━┳╯╰╮ \n┃┃╱┃┃╭╮┃╭╮┣╮╭╯ \n┃╰━╯┃╰╯┃╰╯┃┃┃ \n ╰━━━┻━━┻━━╯╰╯",
        "╭━━━╮╱╱╱╱╱╱╱╱╱╭━╮ \n┃╭━╮┃╱╱╱╱╱╱╱╱╱┃╭╯ \n┃┃╱┃┣━━┳━━┳━━┳╯╰╮ \n┃┃╱┃┃╭╮┃╭╮┃╭╮┣╮╭╯ \n┃╰━╯┃╰╯┃╰╯┃╰╯┃┃┃ \n╰━━━┻━━┻━━┻━━╯╰╯",
        "╭━━━╮╱╱╱╱╱╱╱╱╱╱╱╱╭━╮ \n┃╭━╮┃╱╱╱╱╱╱╱╱╱╱╱╱┃╭╯ \n┃┃╱┃┣━━┳━━┳━━┳━━┳╯╰╮ \n┃┃╱┃┃╭╮┃╭╮┃╭╮┃╭╮┣╮╭╯ \n┃╰━╯┃╰╯┃╰╯┃╰╯┃╰╯┃┃┃ \n╰━━━┻━━┻━━┻━━┻━━╯╰╯",
        "╭━━━╮╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╭━╮ \n┃╭━╮┃╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱┃╭╯ \n┃┃╱┃┣━━┳━━┳━━┳━━┳━━┳╯╰╮ \n┃┃╱┃┃╭╮┃╭╮┃╭╮┃╭╮┃╭╮┣╮╭╯ \n┃╰━╯┃╰╯┃╰╯┃╰╯┃╰╯┃╰╯┃┃┃ \n╰━━━┻━━┻━━┻━━┻━━┻━━╯╰╯",
        "╭━━━╮╱╱╱╱╱╱╱╱╱╱╱╱╭━╮ \n┃╭━╮┃╱╱╱╱╱╱╱╱╱╱╱╱┃╭╯ \n┃┃╱┃┣━━┳━━┳━━┳━━┳╯╰╮ \n┃┃╱┃┃╭╮┃╭╮┃╭╮┃╭╮┣╮╭╯ \n┃╰━╯┃╰╯┃╰╯┃╰╯┃╰╯┃┃┃ \n╰━━━┻━━┻━━┻━━┻━━╯╰╯",
        "╭━━━╮╱╱╱╱╱╱╱╱╱╭━╮ \n┃╭━╮┃╱╱╱╱╱╱╱╱╱┃╭╯ \n┃┃╱┃┣━━┳━━┳━━┳╯╰╮ \n┃┃╱┃┃╭╮┃╭╮┃╭╮┣╮╭╯ \n┃╰━╯┃╰╯┃╰╯┃╰╯┃┃┃ \n╰━━━┻━━┻━━┻━━╯╰╯",
    ]

    for i in animation_ttl:

        await asyncio.sleep(animation_interval)
        await event.eor(animation_chars[i % 40])


CMD_HELP.update({"bigoof": ".bigoof\nTry it yourself!"})
Exemple #14
0
        "image_file": (input_file_name, open(input_file_name, "rb")),
    }
    r = requests.post(
        "https://api.remove.bg/v1.0/removebg",
        headers=headers,
        files=files,
        allow_redirects=True,
        stream=True,
    )
    return r


def ReTrieveURL(input_url):
    headers = {
        "X-API-Key": Config.REM_BG_API_KEY,
    }
    data = {"image_url": input_url}
    r = requests.post(
        "https://api.remove.bg/v1.0/removebg",
        headers=headers,
        data=data,
        allow_redirects=True,
        stream=True,
    )
    return r


CMD_HELP.update(
    {"removebg": ".remove.bg <reply to pic>\nUse - Remove the background of the pic."}
)
Exemple #15
0
            "(▰˘︹˘▰)",
            "●︿●",
            "( ´_ノ` )",
            "彡(-_-;)彡",
        ]
    elif input_str in "dog":
        emoticons = [
            "-ᄒᴥᄒ-",
            "◖⚆ᴥ⚆◗",
        ]
    else:
        emoticons = [
            "( ͡° ͜ʖ ͡°)",
            r"¯\_(ツ)_/¯",
            "( ͡°( ͡° ͜ʖ( ͡° ͜ʖ ͡°)ʖ ͡°) ͡°)",
            "ʕ•ᴥ•ʔ",
            "(▀ Ĺ̯▀   )",
            "(ง ͠° ͟ل͜ ͡°)ง",
            "༼ つ ◕_◕ ༽つ",
            "ಠ_ಠ",
            "(☞ ͡° ͜ʖ ͡°)☞",
            r"¯\_༼ ି ~ ି ༽_/¯",
            "c༼ ͡° ͜ʖ ͡° ༽⊃",
        ]
    index = random.randint(0, len(emoticons))
    output_str = emoticons[index]
    await event.edit(output_str)


CMD_HELP.update({"jainder": ".jainder\nUse - None."})
Exemple #16
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"
})
Exemple #17
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).`")


CMD_HELP.update({
    "account_edits":
    "➟ .pbio <text>\n     To change your profile bio to <text>.\
         \n\n➟ .pname <name>\n     Change your profile name to <name>.\
         \n\n➟ .ppic (reply to pic)\n      To change your profile pic to the replied picture.\
         \n\n➟ .delpfp <number>(optional)\n    To delete 'n' number of profile pics, one if no number specified."
})
Exemple #18
0
        await eor(event, "`.invite` users to a chat, not to a Private Message")
    else:
        logger.info(to_add_users)
        if not event.is_channel and event.is_group:
            # https://lonamiwebs.github.io/Telethon/methods/messages/add_chat_user.html
            for user_id in to_add_users.split(" "):
                try:
                    await borg(
                        functions.messages.AddChatUserRequest(
                            chat_id=event.chat_id, user_id=user_id, fwd_limit=1000000
                        )
                    )
                except Exception as e:
                    await event.reply(str(e))
            await eor(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 eor(event, "Mlobot User has invited the user to the chat.")


CMD_HELP.update({"invite": ".invite <username>\nUse - Add user to the chat."})
Exemple #19
0
#
# Licensed under the Raphielscape Public License, Version 1.b (the "License");
# you may not use this file except in compliance with the License.
#

from asyncio import wait

from mlobot import CMD_HELP
from mlobot.mlobotConfig import Var
from mlobot.utils import admin_cmd


@mlobot.on(admin_cmd(pattern=r"spam", outgoing=True))
async def spammer(e):
    if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"):
        message = e.text
        counter = int(message[6:8])
        spam_message = str(e.text[8:])

        await wait([e.respond(spam_message) for i in range(counter)])

        await e.delete()
        if Var.PRIVATE_GROUP_ID:
            await e.client.send_message(
                Var.PRIVATE_GROUP_ID, "#SPAM \n\n"
                "Spam was executed successfully")


CMD_HELP.update(
    {"spam": ".spam <n> <text>\nUse -Spam the word/sentence 'n' times."})
Exemple #20
0
                                          filter=ChannelParticipantsAdmins):
        mentions += f""
    reply_message = None
    if event.reply_to_msg_id:
        reply_message = await event.get_reply_message()
        await reply_message.reply(mentions)
    else:
        await event.reply(mentions)
    await event.delete()


@mlobot.on(admin_cmd(pattern="pay"))
async def _(event):
    if event.fwd_from:
        return
    mentions = "`█▀▀▀▀▀█░▀▀░░░█░░░░█▀▀▀▀▀█\n█░███░█░█▄░█▀▀░▄▄░█░███░█\n█░▀▀▀░█░▀█▀▀▄▀█▀▀░█░▀▀▀░█\n▀▀▀▀▀▀▀░▀▄▀▄▀▄█▄▀░▀▀▀▀▀▀▀\n█▀█▀▄▄▀░█▄░░░▀▀░▄█░▄▀█▀░▀\n░█▄▀░▄▀▀░░░▄▄▄█░▀▄▄▄▀▄▄▀▄\n░░▀█░▀▀▀▀▀▄█░▄░████ ██▀█▄\n▄▀█░░▄▀█▀█▀░█▄▀░▀█▄██▀░█▄\n░░▀▀▀░▀░█▄▀▀▄▄░▄█▀▀▀█░█▀▀\n█▀▀▀▀▀█░░██▀█░░▄█░▀░█▄░██\n█░███░█░▄▀█▀██▄▄▀▀█▀█▄░▄▄\n█░▀▀▀░█░█░░▀▀▀░█░▀▀▀▀▄█▀░\n▀▀▀▀▀▀▀░▀▀░░▀░▀░░░▀▀░▀▀▀▀`"
    chat = await event.get_input_chat()
    async for x in borg.iter_participants(chat,
                                          filter=ChannelParticipantsAdmins):
        mentions += f""
    reply_message = None
    if event.reply_to_msg_id:
        reply_message = await event.get_reply_message()
        await reply_message.reply(mentions)
    else:
        await event.reply(mentions)
    await event.delete()


CMD_HELP.update({"design": "Random codes.\nCommands - .join\n.pay"})
Exemple #21
0
    time.time() + PROCESS_RUN_TIME
    process = await asyncio.create_subprocess_shell(
        cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
    stdout, stderr = await process.communicate()
    e = stderr.decode()
    if not e:
        e = "No Error"
    o = stdout.decode()
    if not o:
        o = "**Tip**: \n`If you want to see the results of your code, I suggest printing them to stdout.`"
    else:
        _o = o.split("\n")
        o = "`\n".join(_o)
    OUTPUT = f"**QUERY**\n\n__►__ **Command**\n`{cmd}`\n\n__►__ **PID**\n`{process.pid}`\n\n**__►__ **stderr** \n`{e}`\n\n**__►__** Output:**\n`{o}`"
    if len(OUTPUT) > 4095:
        with io.BytesIO(str.encode(OUTPUT)) as out_file:
            out_file.name = "exec.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 eor(event, OUTPUT)


CMD_HELP.update({"bash": ".bash <code>\nUse - Run a code."})
Exemple #22
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 eor(event, 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."
})
Exemple #23
0
            ),
        )
    except Exception:
        await eor(event, "This person does not have Lydia activated on him/her.")


@bot.on(events.NewMessage(incoming=True))
async def user(event):
    event.text
    try:
        session = ACC_LYDIA[event.chat_id & event.sender_id]
        msg = event.text
        async with event.client.action(event.chat_id, "typing"):
            text_rep = session.think_thought(msg)
            wait_time = 0
            for i in range(len(text_rep)):
                wait_time = wait_time + 0.1
            await asyncio.sleep(wait_time)
            await event.reply(text_rep)
    except (KeyError, TypeError):
        return


CMD_HELP.update(
    {
        "lydia": ".repcf <reply to user>\nUse - Reply to that message with AI.\
        \n\n.addcf <reply to user>\nUse - Activate AI on the user.\
        \n\n.remcf <reply to user>\nUse - DeActivate AI on the user."
    }
)
Exemple #24
0
                    ))

                created_chat_id = r.chats[0].id

                result = await grop.client(
                    functions.messages.ExportChatInviteRequest(
                        peer=created_chat_id, ))

                await grop.edit(
                    "Your `{}` Group/Channel Has been made Sir ji say thanks!. Join [{}]({})"
                    .format(group_name, group_name, result.link))

            except Exception as e:  # pylint:disable=C0103,W0703

                await grop.edit(str(e))


CMD_HELP.update({
    "create":
    "\
Create\
\nUsage: Create Channel, Group & Group With Bot.\
\n\n.create g\
\nUsage: Create a Private Group.\
\n\n.create b\
\nUsage: Create a Group with Bot.\
\n\n.create c\
\nUsage: Create a Channel.\
"
})
Exemple #25
0
import asyncio

from mlobot import CMD_HELP
from mlobot.utils import admin_cmd


@mlobot.on(admin_cmd(pattern="schd ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    ttl = 0
    message = "SYNTAX: `.schd <time_in_seconds> = <message to send>`"
    if input_str:
        await event.delete()
        if "=" in input_str:
            ttl, message = input_str.split("=")
        elif event.reply_to_msg_id:
            await event.delete()
            ttl = int(input_str)
            message = await event.get_reply_message()
        await asyncio.sleep(int(ttl))
        await event.respond(message)
    else:
        await event.edit(message)


CMD_HELP.update(
    {"schd": ".schd <time in sec> = <mssg to send>\nUse - Send a scheduled message."}
)
Exemple #26
0
    elif private is True:
        userid = event.chat_id
    else:
        return await eor(
            event,
            "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 eor(event, "This user is not gmuted")
    try:
        unmute(userid, "gmute")
    except Exception as e: 1137511834:
        await eor(event, "Error occured!\nError is " + str(e))
    else:
        await eor(event, "Successfully ungmuted the n***a")


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


CMD_HELP.update(
    {
        "gmute": ".gmute <reply to user>\nUse - Globally mute the person (across all chats).\
        \n\n.ungmute <reply to user>\nUse - Globally UnMute the person."
    }
)
Exemple #27
0
@mlobot.on(events.NewMessage(incoming=True, func=lambda e: e.is_private))
async def monito_p_m_s(event):
    sender = await event.get_sender()
    if Config.NC_LOG_P_M_S and not sender.bot:
        chat = await event.get_chat()
        if chat.id not in NO_PM_LOG_USERS and chat.id != borg.uid:
            try:
                if Config.PM_LOGGR_BOT_API_ID:
                    if event.message:
                        e = await borg.get_entity(
                            int(Config.PM_LOGGR_BOT_API_ID))
                        fwd_message = await borg.forward_messages(
                            e, event.message, silent=True)
                    else:
                        return
                else:
                    return
            except Exception as e:
                # logger.warn(str(e))
                exc_type, exc_obj, exc_tb = sys.exc_info()
                fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
                print(exc_type, fname, exc_tb.tb_lineno)
                print(e)


CMD_HELP.update({
    "saver":
    ".save <reply to mssg>\
      \nUSAGE: saves taged message in private group .\ "
})
Exemple #28
0
from mlobot.utils import admin_cmd

DEL_TIME_OUT = 60


@mlobot.on(admin_cmd(pattern="autobio"))  # pylint:disable=E0602
async def _(event):
    if event.fwd_from:
        return
    while True:
        DMY = time.strftime("%d.%m.%Y")
        HM = time.strftime("%H:%M:%S")
        bio = f"📅 {DMY} | This is my bio, I guess.. 😁 | ⌚️ {HM}"
        logger.info(bio)
        try:
            await borg(
                functions.account.UpdateProfileRequest(  # pylint:disable=E0602
                    about=bio))
        except FloodWaitError as ex:
            logger.warning(str(e))
            await asyncio.sleep(ex.seconds)
        # else:
        # logger.info(r.stringify())
        await borg.send_message(Var.PRIVATE_GROUP_ID,
                                "#Auto_Bio\nSuccessfully enabled auto-bio.")
        await asyncio.sleep(DEL_TIME_OUT)


CMD_HELP.update(
    {"autobio": ".autobio\nUse - Auto-changing profile bio, with time"})
Exemple #29
0
    # await event.edit(f"Restarting \n■■■■□□□□□□  ")
    # await asyncio.sleep(2)
    # await event.edit(f"Restarting \n■■■■■■■■□□   ")
    # await asyncio.sleep(2)
    # await event.edit(f"Done! \n■■■■■■■■■■  ")
    # await asyncio.sleep(2)
    await event.edit(
        f"__MloBot is Restarting...__\nPlease give it **a minute or two** and then use `{CMD_HNDLR}alive`! "
    )
    await borg.disconnect()
    # https://archive.is/im3rt
    os.execl(sys.executable, sys.executable, *sys.argv)
    # You probably don't need it but whatever
    quit()


@mlobot.on(admin_cmd(pattern="shutdown"))
async def _(event):
    if event.fwd_from:
        return
    await event.edit(
        "MloBot is turning off... Manually turn me on later, from heroku.")
    await borg.disconnect()


CMD_HELP.update({
    "power_tools":
    ".restart\nUse - Restart the bot.\
        \n\n.shutdown\nUse - shutdown the bot."
})
Exemple #30
0
        if idd == 1137511834:
            await reply_message.reply(
                "`Wait a second, This is my master!`\n**How dare you threaten to ban my master Nikal fursat me!**\n\n__Your account has been hacked! 😏"
            )
        else:
            jnl = ("`Warning!! `"
                   "[{}](tg://user?id={})"
                   "` 𝙂𝘽𝘼𝙉𝙉𝙀𝘿 By Admin...\n\n`"
                   "**Name: ** __{}__\n"
                   "**ID : ** `{}`\n").format(firstname, idd, firstname, idd)
            if usname is None:
                jnl += "**Victim's username: ** `Doesn't own a username!`\n"
            elif usname != "None":
                jnl += "**Victim's username** : @{}\n".format(usname)
            if len(gbunVar) > 0:
                gbunm = "`{}`".format(gbunVar)
                gbunr = "**Reason: **" + gbunm
                jnl += gbunr
            else:
                jnl += no_reason
            await reply_message.reply(jnl)
    else:
        mention = (
            "`Warning!! User 𝙂𝘽𝘼𝙉𝙉𝙀𝘿 By Admin...\nReason: Potential P**n Addict. `"
        )
        await event.reply(mention)
    await event.delete()


CMD_HELP.update({"gbun": ".gbun <reply to user>\nUse - Fake Gban."})