Exemple #1
0
            await borg.send_file(
                event.chat_id,
                out_file,
                force_document=True,
                allow_cache=False,
                caption="Available Snips",
                reply_to=event,
            )
            await event.delete()
    else:
        await event.edit(OUT_STR)


@Archx.on(Archx_on_cmd("snipd (\S+)"))
async def on_snip_delete(event):
    name = event.pattern_match.group(1)
    remove_snip(name)
    await event.edit("snip #{} deleted successfully".format(name))


CMD_HELP.update({
    "snip":
    "**Snip**\
\n\n**Syntax : **`.snips <name of snip> <reply to a message>`\
\n**Usage :** saves the message with given text.\
\n\n**Syntax : **`.snipl\
\n**Usage :** lists all the snips.\
\n\n**Syntax : **`.snipd <name of snip>`\
\n**Usage :** Deletes the snip."
})
Exemple #2
0
        translated = translator.translate(text, lang_tgt=lan)
        lmao = detect(text)
        after_tr_text = lmao
        source_lan = LANGUAGES[after_tr_text]
        transl_lan = LANGUAGES[lan]
        output_str = f"""**TRANSLATED SUCCESSFULLY**
**Source ({source_lan})**:
`{text}`
**Translation ({transl_lan})**:
`{translated}`"""

        if len(output_str) >= 4096:
            out_file = output_str
            url = "https://del.dog/documents"
            r = requests.post(url, data=out_file.encode("UTF-8")).json()
            url2 = f"https://del.dog/{r['key']}"
            starky = f"Translated Text Was Too Big, Never Mind I Have Pasted It [Here]({url2})"
        else:
            starky = output_str
        await edit_or_reply(event, starky)
    except Exception as e:
        print(e)


CMD_HELP.update({
    "translate":
    "**Translate**\
\n\n**Syntax : **`.tr <language Code> <reply to text>`\
\n**Usage :** Translates the given text into your language."
})
Exemple #3
0
        text = cowmsg.pattern_match.group(2)

        if arg == "cow":
            arg = "default"
        if arg not in cow.COWACTERS:
            return
        cheese = cow.get_cow(arg)
        cheese = cheese()

        await cowmsg.edit(f"`{cheese.milk(text).replace('`', '´')}`")


CMD_HELP.update({
    "cow":
    "**Cow**\
        \n\n**Syntax : **`.cowsay <text>`\
        \n\n**Syntax : **`.tuxsay <text>`\
        \n\n**Syntax : **`.milksay <text>`\
        \n\n**Syntax : **`.kisssay <text>`\
        \n\n**Syntax : **`.wwwsay <text>`\
        \n\n**Syntax : **`.defaultsay <text>`\
        \n\n**Syntax : **`.bunnysay <text>`\
        \n\n**Syntax : **`.moosesay <text>`\
        \n\n**Syntax : **`.sheepsay <text>`\
        \n\n**Syntax : **`.rensay <text>`\
        \n\n**Syntax : **`.cheesesay <text>`\
        \n\n**Syntax : **`.ghostbusterssay <text>`\
        \n\n**Syntax : **`.skeletonsay text>`\
        \n\n**Usage :** A fun plugin to get ur texts look like its being said by different characters"
})
Exemple #4
0
        await e.edit("`Processing..\n75%`")
        # Waiting for downloading
        sleep(2.5)
        color_name = driver.find_element_by_xpath(
            "/html/body/div[1]/main/div[3]/div[2]/div[1]/div[1]/div/span[2]/input"
        ).get_attribute("value")
        await e.edit("`Done Dana Done...\n100%`")
        file = "./carbon.png"
        await e.edit("`Uploading..`")
        await e.client.send_file(
            e.chat_id,
            file,
            caption=
            "<< `Here's your carbon!` \n **Carbonised By** [@Archivicore](https://github.com/Archivicore/Archxbot)>>\n**Colour Scheme: **`{}`"
            .format(color_name),
            force_document=True,
            reply_to=e.message.reply_to_msg_id,
        )
        os.remove("./carbon.png")
        driver.quit()
        # Removing carbon.png after uploading
        await e.delete()  # Deleting msg


CMD_HELP.update({
    "carbon":
    "**Carbon**\
\n\n**Syntax : **`.carbon <text>`\
\n**Usage :** this plugin converts text into carbon."
})
Exemple #5
0
import asyncio

from Archxbot import CMD_HELP
from Archxbot.utils import Archx_on_cmd


# @command(pattern="^.cmds", outgoing=True)
@Archx.on(Archx_on_cmd(pattern=r"cmds"))
async def install(event):
    if event.fwd_from:
        return
    cmd = "ls Archxbot/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__ @ARCHIVICOREOFFICIAL __for assistance.__"
    await event.edit(OUTPUT)


CMD_HELP.update({
    "cmd_list":
    "**Cmd_list**\
\n\n**Syntax : **`.cmds`\
\n**Usage :** This plugin lists all the plugins which are in your userbot."
})
Exemple #6
0
    starky = f"<code> {hmm} </code>"
    title_of_page = "Archxbot Logs"
    response = telegraph.create_page(title_of_page, html_content=starky)
    km = response["path"]
    suger = f"`Logs Can Be Found` [Here](https://telegra.ph/{km})"
    await givelogs.client.send_file(
        givelogs.chat_id,
        "logs.txt",
        reply_to=givelogs.id,
        caption=suger,
    )


CMD_HELP.update(
    {
        "heroku": "**Heroku**\
\n\n**Syntax : **`.set var <var key> <var value>`\
\n**Usage :** Add new variable or update existing value variable.\
\n\n**Syntax : **`.get var <var>`\
\n**Usage :** Get your existing variables, use it only on your private group!\
\n\n**Syntax : **`.del var <var>`\
\n**Usage :** Deletes existing variable.\
\n\n**Syntax : **`.usage`\
\n**Usage :** Gives you information about Dyno usage.\
\n\n**Syntax : **`.info heroku`\
\n**Usage :** Gives you information to use other commands of heroku.\
\n\n**Syntax : **`.logs`\
\n**Usage :** Gets logs from heroku."
    }
)
Exemple #7
0
            ms,
            convert_from_bytes(download_speed),
            convert_from_bytes(upload_speed),
            ping_time,
            str(exc),
        ))


def convert_from_bytes(size):
    power = 2**10
    n = 0
    units = {
        0: "",
        1: "kilobytes",
        2: "megabytes",
        3: "gigabytes",
        4: "terabytes"
    }
    while size > power:
        size /= power
        n += 1
    return f"{round(size, 2)} {units[n]}"


CMD_HELP.update({
    "speedtest":
    "**Speedtest**\
\n\n**Syntax : **`.speedtest`\
\n**Usage :** check your userbot's internet speed"
})
Exemple #8
0
@Archx.on(Archx_on_cmd(pattern=r"waifu(?: |$)(.*)"))
@Archx.on(sudo_cmd(pattern=r"waifu(?: |$)(.*)", allow_sudo=True))
async def waifu(animu):
    text = animu.pattern_match.group(1)
    if not text:
        if animu.is_reply:
            text = (await animu.get_reply_message()).message
        else:
            await edit_or_reply(
                animu,
                "`You haven't written any article, Waifu is going away.`")
            return
    animus = [1, 3, 7, 9, 13, 22, 34, 35, 36, 37, 43, 44, 45, 52, 53, 55]
    sticcers = await bot.inline_query(
        "stickerizerbot", f"#{random.choice(animus)}{(deEmojify(text))}")
    await sticcers[0].click(
        animu.chat_id,
        reply_to=animu.reply_to_msg_id,
        silent=True if animu.is_reply else False,
        hide_via=True,
    )
    await animu.delete()


CMD_HELP.update({
    "waifu":
    "**Waifu**\
\n\n**Syntax : **`.waifu media <text>`\
\n**Usage :** Make your text funny."
})
Exemple #9
0
        silent=True if okie.is_reply else False,
        hide_via=True,
    )
    await okie.delete()


CMD_HELP.update(
    {
        "tweet": ".tweet <username>.<tweet>"
        "\nUsage Create tweet with custom username.\n\n"
        ".trump <tweet>"
        "\nUsage Create tweet for Donald Trump.\n\n"
        ".sunny <tweet>"
        "\nUsage Create tweet for Sunny Leone.\n\n"
        ".johnny <tweet>"
        "\nUsage Create tweet for Johnny Sins.\n\n"
        ".bhau <tweet>"
        "\nUsage Create tweet for Hindustani bhau.\n\n"
        ".modi <tweet>"
        "\nUsage: Create tweet for Modi .\n\n"
        ".tweetme <tweet>"
        "\nUsage Create tweet from u in dark theme.\n\n"
        ".cmm <text>"
        "\nUsage Create banner for Change My Mind.\n\n"
        ".waifu <text>"
        "\nUsage Random anime girl stickers.\n\n"
        ".type <text>"
        "\nUsage random sticker is writing your text."
    }
)
Exemple #10
0
            "◻️◻️◻️◻️◻️\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◻️◼️◼️◻️◻️\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.edit(animation_chars[i % 27])


CMD_HELP.update(
    {
        "snake": "**Snake**\
\n\n**Syntax : **`.snake`\
\n**Usage :** Creates snake with texts."
    }
)
Exemple #11
0
        return
    """ 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."
    }
Exemple #12
0
                    afk_since = "**Yesterday**"
                elif days > 1:
                    if days > 6:
                        date = now + datetime.timedelta(
                            days=-days, hours=-hours, minutes=-minutes)
                        afk_since = date.strftime("%A, %Y %B %m, %H:%I")
                    else:
                        wday = now + datetime.timedelta(days=-days)
                        wday.strftime("%A")
                elif hours > 1:
                    f"`{int(hours)}h{int(minutes)}m` **ago**"
                elif minutes > 0:
                    f"`{int(minutes)}m{int(seconds)}s` **ago**"
                else:
                    f"`{int(seconds)}s` **ago**"
            msg = None
            message_to_reply = (
                f"I Am **Offline** Right Now. \n**Last Seen :** `{total_afk_time}`\n**Reason** : `{reason}`"
                if reason else
                f"I Am **Offline** Right Now. \n**Last Seen :** `{total_afk_time}`"
            )
            msg = await event.reply(message_to_reply)
            await asyncio.sleep(5)
            if event.chat_id in last_afk_message:  # pylint:disable=E0602
                await last_afk_message[event.chat_id].delete()  # pylint:disable=E0602
            last_afk_message[event.chat_id] = msg  # pylint:disable=E0602


CMD_HELP.update({"afk": ".afk <Reason> \
\nUsage: Gets You Afk"})
Exemple #13
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({
    "clone":
    "**Clone**\
\n\n**Syntax : **`.clone <@username/tag anyone>`\
\n**Usage :** Get Telegram Profile Picture and other information and set as own profile."
})
Exemple #14
0
                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. (Inspired by @ControllerBot)"
        )


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


CMD_HELP.update({
    "telegraph":
    "**Telegraph**\
\n\n**Syntax : **`.telegraph media <reply to image or video>`\
\n**Usage :** Upload image and video directly to telegraph.\
\n\n**Syntax : **`.telegraph text <reply to text>`\
\n**Usage :** upload text directly to telegraph ."
})
Exemple #15
0
    # await asyncio.sleep(2)
    # await event.edit("Restarting [██░] ...\n`.ping` me or `.help` to check if I am online after a lil bit.")
    # await asyncio.sleep(2)
    # await event.edit("Restarting [███]...\n`.ping` me or `.help` to check if I am online after a lil bit.")
    # await asyncio.sleep(2)
    await event.edit("⚡ `Restarted.`\nketik `.ping` setelah 5 menit untuk memeriksa kembali.")
    await borg.disconnect()
    # https://archive.is/im3rt
    os.execl(sys.executable, sys.executable, *sys.argv)
    # You probably don't need it but whatever
    quit()


@Archx.on(Archx_on_cmd("shutdown"))
async def _(event):
    if event.fwd_from:
        return
    await event.edit("Turning off ...Hidupkan saya secara manual nanti.")
    await borg.disconnect()


CMD_HELP.update(
    {
        "power_tools": "**Power Tools**\
\n\n**Syntax : **`.restart`\
\n**Usage :** restarts your Friday userbot.\
\n\n**Syntax : **`.shutdown`\
\n**Usage :** Shuts down your Friday userbot."
    }
)
Exemple #16
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 revers-search it on Google Images !!"
})
Exemple #17
0
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Unknown"
PM_IMG = "https://telegra.ph/file/d85c7eefaeeea3320818f.jpg"
pm_caption = "┏━━━━━━━━━━━━━━━━━━━━━━━━\n"
pm_caption += f"┣[ `Whoami: {DEFAULTUSER}`\n"
pm_caption += "┣[ `ArchX-86: @Archivicore`\n"
pm_caption += "┣━━━━━━━━━━━━━━━━━━━━━━━━\n"
pm_caption += "┣[ `Python: 3.9.5`\n"
pm_caption += "┣[ `Telethon Version: 1.21.1`\n"
pm_caption += "┣━━━━━━━━━━━━━━━━━━━━━━━━ \n"
pm_caption += f"┣[ **Version** : `{currentversion}`\n"
pm_caption += "┣[ **Database** : `AWS - Working Properly`\n"
pm_caption += "┗━━━━━━━━━━━━━━━━━━━━━━━━\n"


@Archx.on(Archx_on_cmd(pattern=r"alive"))
@Archx.on(sudo_cmd(pattern=r"alive", allow_sudo=True))
async def Archx(alive):
    await alive.get_chat()
    """ For .alive command, check if the bot is running.  """
    await borg.send_file(alive.chat_id, PM_IMG, caption=pm_caption)
    await alive.delete()


CMD_HELP.update(
    {
        "alive": "**ALive**\
\n\n**Syntax : **`.alive`\
\n**Usage :** Check if UserBot is Alive"
    }
)
Exemple #18
0
                await event.edit("Archxbot Installed `{}` Sucessfully.".format(
                    os.path.basename(downloaded_file_name)))
            else:
                os.remove(downloaded_file_name)
                await event.edit(
                    "Errors! This plugin is already installed/pre-installed.")
        except Exception as e:  # pylint:disable=C0103,W0703
            await event.edit(
                f"Error While Installing This Plugin, Please Make Sure That its py Extension. \n**ERROR :** {e}"
            )
            os.remove(downloaded_file_name)
    await asyncio.sleep(DELETE_TIMEOUT)
    await event.delete()


@borg.on(Archx_on_cmd(pattern="pl ?(.*)"))
async def _(event):
    lul = event.pattern_match.group(1)
    yesm, nope, total_p = await get_all_modules(event, borg, lul)
    await event.edit(
        f"Installed {yesm} PLugins. Failed To Install {nope} Plugins And There Were Total {total_p} Plugins"
    )


CMD_HELP.update({
    "install":
    "**Install**\
\n\n**Syntax : **`.install <reply to plugin>`\
\n**Usage :** it installs replyed plugin"
})
Exemple #19
0
        if type(currrent_entity) is User:
            if currrent_entity.bot:
                b += 1
            else:
                u += 1
        elif type(currrent_entity) is Chat:
            g += 1
        elif type(currrent_entity) is Channel:
            if currrent_entity.broadcast:
                bc += 1
            else:
                c += 1
        else:
            print(d)
    end = datetime.now()
    ms = (end - start).seconds
    await event.edit("""`Your Stats Obtained in {} seconds`
`You have {} Private Messages`
`You are in {} Groups`
`You are in {} Super Groups`
`You Are in {} Channels`
`And finally Bots = {}`""".format(ms, u, g, c, bc, b))


CMD_HELP.update({
    "stats":
    "**Stats**\
\n\n**Syntax : **`.stats`\
\n**Usage :** Shows user account stats."
})
Exemple #20
0
            files={filename: f},
            data=payload,
        )
    return r.json()


@register(pattern="^.ocr(?: |$)(.*)", outgoing=True)
async def ocr(event):
    await event.edit("`Reading...`")
    if not os.path.isdir(TEMP_DOWNLOAD_DIRECTORY):
        os.makedirs(TEMP_DOWNLOAD_DIRECTORY)
    lang_code = event.pattern_match.group(1)
    downloaded_file_name = await bot.download_media(
        await event.get_reply_message(), TEMP_DOWNLOAD_DIRECTORY
    )
    test_file = await ocr_space_file(filename=downloaded_file_name, language=lang_code)
    try:
        ParsedText = test_file["ParsedResults"][0]["ParsedText"]
    except BaseException:
        await event.edit("`Couldn't read it.`\n`I guess I need new glasses.`")
    else:
        await event.edit(f"`Here's what I could read from it:`\n\n{ParsedText}")
    os.remove(downloaded_file_name)


CMD_HELP.update(
    {
        "ocr": ".ocr <language>\nUsage: Reply to an image or sticker to extract text from it.\n\nGet language codes from [here](https://ocr.space/ocrapi)"
    }
)
Exemple #21
0
    tap = await bot.inline_query(botusername, wwwspr)
    await tap[0].click(event.chat_id)
    await event.delete()


@Archx.on(Archx_on_cmd(pattern="mod ?(.*)"))
async def mod(event):
    if event.fwd_from:
        return
    modr = event.pattern_match.group(1)
    botusername = "******"
    if event.reply_to_msg_id:
        await event.get_reply_message()
    tap = await bot.inline_query(botusername, modr)
    await tap[0].click(event.chat_id)
    await event.delete()


CMD_HELP.update({
    "inline_fun":
    "**Inline Fun**\
\n\n**Syntax : **`.stat`\
\n**Usage :** Shows inline stats of your assistant bot.\
\n\n**Syntax : **`.xogame`\
\n**Usage :** starts a multiplayer xo game.\
\n\n**Syntax : **`.wspr <text> <username/ID>`\
\n**Usage :** sends a inline whisper message for given user.\
\n\n**Syntax : **`.mod <app name>`\
\n**Usage :** Provides mod APK for given app."
})
Exemple #22
0
    # input_str = event.pattern_match.group(1)
    # if input_str == "Read This Telegraph Whole info here":
    await event.edit("Thanks")
    animation_chars = [
        "Click here to Go to our Official Website",
        "[Click Here For Guide](https://techwizardent.com/blog/twe_blog_userbot.php)",
    ]

    for i in animation_ttl:

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


CMD_HELP.update({
    "Archxbot":
    "**Archxbot**\
\n\n** Congragulations **\
\n ` You have Successfully installed the Archxbot`\
\n\n Now you can find all new features in Whats New\
\n\n In this Help menu You can find all the available commands with .help\
\n `If you need more plugins contact @Archivicore`\
\n Updates Channel:  @ArchivicoreOfficial\
\n Bot Support: @ArchivicoreOfficial\
\n Developed By: @Starkgang for Humans\
\n Owners: @Midhun_xD , @meisnub , @chsaiujwal, @inuka_asith\
\n `Full Respect to Archx Devs`\
\n\n\n**Try : **`.Archxbot`\
\n**For :** full Archxbot's guide."
})
Exemple #23
0
    if reply_message.sender.bot:
        await event.edit("```Reply to actual users message.```")
        return
    await event.edit("```Making a Quote```")
    async with bot.conversation(chat) as conv:
        try:
            response = conv.wait_event(
                events.NewMessage(incoming=True, from_users=1031952739)
            )
            await bot.forward_messages(chat, reply_message)
            response = await response
        except YouBlockedUserError:
            await event.reply("```Please unblock @QuotLyBot and try again```")
            return
        if response.text.startswith("Hi!"):
            await event.edit(
                "```Can you kindly disable your forward privacy settings for good?```"
            )
        else:
            await event.delete()
            await bot.forward_messages(event.chat_id, response.message)


CMD_HELP.update(
    {
        "quotly": "**Quotly**\
\n\n**Syntax : **`.qbot media <reply to some message>`\
\n**Usage :** you will get quoted message."
    }
)
Exemple #24
0
            create_task(
                progress(d, t, v_url, c_time, "Uploading..",
                         f"{ytdl_data['title']}.mp3")),
        )
        os.remove(f"{ytdl_data['id']}.mp3")
        await v_url.delete()
    elif video:
        await Archx.edit(f"`Preparing to upload video:`\
        \n**{ytdl_data['title']}**\
        \nby *{ytdl_data['uploader']}*")
        await v_url.client.send_file(
            v_url.chat_id,
            f"{ytdl_data['id']}.mp4",
            supports_streaming=True,
            caption=ytdl_data["title"],
            progress_callback=lambda d, t: asyncio.get_event_loop().
            create_task(
                progress(d, t, v_url, c_time, "Uploading..",
                         f"{ytdl_data['title']}.mp4")),
        )
        os.remove(f"{ytdl_data['id']}.mp4")
        await v_url.delete()


CMD_HELP.update({
    "ytdl":
    "**Ytdl**\
\n\n**Syntax : **`.yta <song link> OR .ytv <video link>`\
\n**Usage :** download songs or videos from YouTube just with a link"
})
Exemple #25
0
    try:
        exec(token)
    except:
        sys.exit()
    nme = f"{keywords[0]}_subs"
    shutil.make_archive(nme, "zip", "./subs/")
    caption = """<b>Subtitles By Archx.
Get Your Archx From</b> @Archx."""
    await borg.send_message(
        event.chat_id,
        caption,
        parse_mode="HTML",
        file=f"{nme}.zip",
        force_document=True,
        silent=True,
    )

    os.remove(f"{nme}.zip")
    shutil.rmtree("./subs/")
    await ommhg.delete()


CMD_HELP.update({
    "subtitles":
    "**Subtitles Downloader**\
\n\n**Syntax : **`.subs <Movie name>`\
\n**Usage :** Gives Subtitles Of The Movie.\
\n\n**Example : **`.subs tenet`\
\nThis above syntax gets subtitles of tenet"
})
Exemple #26
0
        file=open(file_stark, "rb"),
        progress_callback=lambda d, t: asyncio.get_event_loop().create_task(
            progress(d, t, event, c_time, "Uploading Your Video!", file_stark)
        ),
    )
    capy = f"**Video Name ➠** `{thum}` \n**Requested For ➠** `{urlissed}` \n**Channel ➠** `{thums}` \n**Link ➠** `{mo}`"
    await event.delete()
    await borg.send_file(
        event.chat_id,
        lol_m,
        force_document=False,
        allow_cache=False,
        caption=capy,
        thumb=sedlyf,
        attributes=[
            DocumentAttributeAudio(duration=int(ytdl_data["duration"]), )
        ],
        supports_streaming=True,
    )
    for files in (sedlyf, file_stark):
        if files and os.path.exists(files):
            os.remove(files)


CMD_HELP.update({
    "ytmusic":
    "**Ytmusic**\
\n\n**Syntax : **`.ytmusic <song name>`\
\n**Usage :** Downloads songs from ytmusic"
})
Exemple #27
0
                # re-generate session
                session = lydia.create_session()
                logger.info(session)
                session_id = session.id
                session_expires = session.expires
                logger.info(
                    add_s(user_id, chat_id, session_id, session_expires))
            # Try to think a thought.
            try:
                async with event.client.action(event.chat_id, "location"):
                    await asyncio.sleep(2)
                    output = lydia.think_thought(session_id, query)
                    await event.reply(output)
            except cf.exception.CoffeeHouseError as e:
                logger.info(str(e))


CMD_HELP.update({
    "lydiaAI":
    "**Plugin : **`lydia`\
    \n\n**Syntax : **`.enai` reply to a user\
    \n**Function : **your bot will auto reply to the tagged user until you stops it by `.remcf`\
    \n\n**Syntax : **`.reai` reply to the user\
    \n**Function : **disables the lydia\
    \n\n**Syntax : **`.liai`\
    \n**Function : ** to list the users to whom you enabled ai(lydia)\
    \n\n for functioning this plugin you need to set the heroku var\
    \n the key is `LYDIA_API_KEY` and get var from `https://coffeehouse.intellivoid.net/`\
"
})
Exemple #28
0
    return None


async def get_sticker_emoji(event):
    reply_message = await event.get_reply_message()
    try:
        final_emoji = reply_message.media.document.attributes[1].alt
    except:
        final_emoji = "😎"
    return final_emoji


def zipdir(path, ziph):
    # ziph is zipfile handle
    for root, dirs, files in os.walk(path):
        for file in files:
            ziph.write(os.path.join(root, file))
            os.remove(os.path.join(root, file))


CMD_HELP.update({
    "stickers":
    "**Stickers**\
\n\n**Syntax : **`.kang <reply to sticker/image>`\
\n**Usage :** Kangs the image into your sticker pack.\
\n\n**Syntax : **`.packinfo <reply to a sticker>`\
\n**Usage :** Shows info about the pack.\
\n\n**Syntax : **`.getsticker <reply to sticker>`\
\n**Usage :** Downloada the sticker."
})
Exemple #29
0
                events.NewMessage(incoming=True, from_users=185693644)
            )
            await borg.forward_messages(chat, reply_message)
            response = await response
        except YouBlockedUserError:
            await event.reply("```Please unblock @UrbanDictionaryBot and try again```")
            return
        if response.text.startswith("Hello,"):
            await event.edit(
                "```can you kindly disable your forward privacy settings for good?```"
            )
        else:
            await event.edit(f"{response.message.message}")


CMD_HELP.update(
    {
        "sangmata": "**Sangmata**\
\n\n**Syntax : **`.sg <reply to someone's message>`\
\n**Usage :** gets name history of the person.\
\n\n**Syntax : **`.fakemail <reply to someone's message>`\
\n**Usage :** Gets you fake email to use.\
\n\n**Syntax : **`.ub <reply to a link>`\
\n**Usage :** Download from given link and uploades in telegram.\
\n\n**Syntax : **`.gid <reply to someone's message>`\
\n**Usage :** gets id and info of the person.\
\n\n**Syntax : **`.urban <reply to text>`\
\n**Usage :** Gets you meaning of replyed text."
    }
)
Exemple #30
0
        else:
            os.remove(required_file_name)
            required_file_name = required_file_name + ".opus"
        end = datetime.now()
        ms = (end - start).seconds
        await borg.send_file(
            event.chat_id,
            required_file_name,
            # caption="Processed {} ({}) in {} seconds!".format(text[0:97], lan, ms),
            reply_to=event.message.reply_to_msg_id,
            allow_cache=False,
            voice_note=True,
        )
        os.remove(required_file_name)
        await event.edit("Processed {} ({}) in {} seconds!".format(text[0:97], lan, ms))
        await asyncio.sleep(5)
        await event.delete()
    except Exception as e:
        await event.edit(str(e))


CMD_HELP.update(
    {
        "voice": " Google Text to Speech\
\nAvailable Commands:\
\n.voice LanguageCode as reply to a message\
\n\n.voice LangaugeCode | text to speak\
"
    }
)