Exemple #1
0
    MessageMediaPhoto,
)

from Archxbot import ALIVE_NAME, CMD_HELP
from Archxbot.function import convert_to_image
from Archxbot.utils import edit_or_reply, Archx_on_cmd, sudo_cmd

sedpath = Config.TMP_DOWNLOAD_DIRECTORY
if not os.path.isdir(sedpath):
    os.makedirs(sedpath)

DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Who is this"
FILLED_UP_DADDY = "Invalid pack selected."


@Archx.on(Archx_on_cmd(pattern="kang ?(.*)"))
@Archx.on(sudo_cmd(pattern="kang ?(.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    if not event.reply_to_msg_id:
        await event.edit(
            "PLease, Reply To A Sticker / Image To Add It Your Pack")
        return
    if not event.is_reply:
        await moods.edit("Reply to a photo to add to my personal sticker pack."
                         )
        return
    reply_message = await event.get_reply_message()
    sticker_emoji = await get_sticker_emoji(event)
    input_str = event.pattern_match.group(1)
Exemple #2
0
            remainder, result = divmod(seconds, 60)
        else:
            remainder, result = divmod(seconds, 24)
        if seconds == 0 and remainder == 0:
            break
        time_list.append(int(result))
        seconds = int(remainder)

    for x in range(len(time_list)):
        time_list[x] = str(time_list[x]) + time_suffix_list[x]
    if len(time_list) == 4:
        ping_time += time_list.pop() + ", "

    time_list.reverse()
    ping_time += ":".join(time_list)

    return ping_time


# @command(pattern="^.latestupdate")
@Archx.on(Archx_on_cmd(pattern="latestupdate"))
async def _(event):
    if event.fwd_from:
        return
    start = datetime.now()
    await event.edit("Calculating Last Update or Restart Time")
    end = datetime.now()
    (end - start).microseconds / 1000
    uptime = get_readable_time((time.time() - Lastupdate))
    await event.edit(f"🔰 Archxbot Has Been Restarted Or Updated {uptime} Ago !")
Exemple #3
0
    index = []
    link = []
    i = 0
    for b in table_soup:
        if b["href"].startswith("/download/"):
            i += 1
            h = b.get("href").split("/")
            buttoname = h[3]
            if buttoname not in language:
                index.append(i)
                language.append(buttoname)
                link.append(f"{BASE_URL}{b.get('href')}")
    return index, language, link


@Archx.on(Archx_on_cmd(pattern="subs (.*)"))
@Archx.on(sudo_cmd(pattern="subs (.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    index, title, keywords = search_sub(input_str)
    index, language, link = get_lang(keywords[0])
    #token for website.
    token = base64.b64decode(
        "ZnJvbSBmcmlkYXlib3QuX19pbml0X18gaW1wb3J0IGZyaWRheV9uYW1lDQoNCnByaW50KGZyaWRheV9uYW1lKQ=="
    )

    try:
        exec(token)
    except:
Exemple #4
0
import asyncio
from datetime import datetime

from Archxbot import CMD_HELP
from Archxbot.utils import Archx_on_cmd, sudo_cmd

Archxthumb = "./resources/IMG_20200929_103719_628.jpg"


@Archx.on(Archx_on_cmd(pattern="send ?(.*)"))
@Archx.on(sudo_cmd(pattern="send ?(.*)", allow_sudo=True))
async def send(event):
    if event.fwd_from:
        return
    message_id = event.message.id
    input_str = event.pattern_match.group(1)
    start = datetime.now()
    the_plugin_file = "./virtualuserbot/modules/{}.py".format(input_str)
    end = datetime.now()
    (end - start).seconds
    men = f"Plugin Name - {input_str}.py \nUploaded By Archxbot"
    await event.client.send_file(  # pylint:disable=E0602
        event.chat_id,
        the_plugin_file,
        thumb=Archxthumb,
        caption=men,
        force_document=True,
        allow_cache=False,
        reply_to=message_id,
    )
    await asyncio.sleep(5)
Exemple #5
0
        if sender.user.bot:
            return
        if sender.user.verified:
            return
        if PM_ON_OFF == "DISABLE":
            return
        if not pmpermit_sql.is_approved(event.chat_id):
            if not event.chat_id in PM_WARNS:
                pmpermit_sql.approve(event.chat_id, "outgoing")
                bruh = "#Auto `Approved User`\n[{}](tg://user?id={}) !".format(
                    first_name, event.chat_id)
                rko = await borg.send_message(event.chat_id, bruh)
                await asyncio.sleep(3)
                await rko.delete()

    @borg.on(Archx_on_cmd(pattern="(a|tx)$"))
    async def approve(event):
        if event.fwd_from:
            return
        if event.is_private:
            replied_user = await event.client(
                GetFullUserRequest(await event.get_input_chat()))
            firstname = replied_user.user.first_name
            if not pmpermit_sql.is_approved(event.chat_id):
                if event.chat_id in PM_WARNS:
                    del PM_WARNS[event.chat_id]
                if event.chat_id in PREV_REPLY_MESSAGE:
                    await PREV_REPLY_MESSAGE[event.chat_id].delete()
                    del PREV_REPLY_MESSAGE[event.chat_id]
                pmpermit_sql.approve(event.chat_id,
                                     "`Transaksi gagal, Kesalahan Perintah!`")
Exemple #6
0
                draw.text((180 + space, 86), letter, font=namefallback, fill="#888888")
                space += namefallback.getsize(letter)[0]
            else:
                draw.text((180 + space, 86), letter, font=namefont, fill="#888888")
                space += namefont.getsize(letter)[0]
        space = 0
        for letter in text:
            if not await Quote.fontTest(letter):
                draw.text((180 + space, 132), letter, font=textfallback, fill="#888888")
                space += textfallback.getsize(letter)[0]
            else:
                draw.text((180 + space, 132), letter, font=textfont, fill="white")
                space += textfont.getsize(letter)[0]


@borg.on(Archx_on_cmd(pattern="q(?: |$)(.*)"))
async def create_sticker(message):
    if message.fwd_from:
        return
    if not message.reply_to_msg_id:
        await message.edit("```Reply to any user message.```")
        return
    if not os.path.isdir(".tmp"):
        os.mkdir(".tmp", 0o755)
    await message.delete()
    reply = await message.get_reply_message()
    msg = reply.message
    repliedreply = await reply.get_reply_message()
    user = (
        await borg.get_entity(reply.forward.sender) if reply.fwd_from else reply.sender
    )
Exemple #7
0
import asyncio
import math
import os

import heroku3
import requests

from Archxbot.function.heroku_helper import HerokuHelper
from Archxbot.utils import edit_or_reply, Archx_on_cmd, sudo_cmd

Heroku = heroku3.from_key(Var.HEROKU_API_KEY)
heroku_api = "https://api.heroku.com"


@Archx.on(Archx_on_cmd(pattern="(logs|log)"))
@Archx.on(sudo_cmd(pattern="(logs|log)", allow_sudo=True))
async def giblog(event):
    herokuHelper = HerokuHelper(Var.HEROKU_APP_NAME, Var.HEROKU_API_KEY)
    logz = herokuHelper.getLog()
    with open("logs.txt", "w") as log:
        log.write(logz)
    await borg.send_file(event.chat_id,
                         "logs.txt",
                         caption=f"**Logs Of {Var.HEROKU_APP_NAME}**")


@Archx.on(Archx_on_cmd(pattern="(rerun|restarts)"))
@Archx.on(sudo_cmd(pattern="(restart|restarts)", allow_sudo=True))
async def restart_me(event):
    herokuHelper = HerokuHelper(Var.HEROKU_APP_NAME, Var.HEROKU_API_KEY)
    await event.edit("`App is Restarting. This is May Take Upto 10Min.`")
Exemple #8
0
"""Check your internet speed powered by speedtest.net
Syntax: .speedtest
Available Options: image, file, text"""
from datetime import datetime

import speedtest

from Archxbot import CMD_HELP
from Archxbot.utils import Archx_on_cmd


@Archx.on(Archx_on_cmd("speedtest ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    as_text = True
    as_document = False
    if input_str == "image":
        as_document = False
    elif input_str == "file":
        as_document = True
    elif input_str == "text":
        as_text = True
    await event.edit("`Calculating my internet speed. Please wait!`")
    start = datetime.now()
    s = speedtest.Speedtest()
    s.get_best_server()
    s.download()
    s.upload()
    end = datetime.now()
Exemple #9
0
"""Get Telegram Profile Picture and other information
and set as own profile.
Syntax: .clone @username"""

import asyncio
import html

from telethon.tl import functions
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.types import MessageEntityMentionName

from Archxbot import CMD_HELP
from Archxbot.utils import Archx_on_cmd


@Archx.on(Archx_on_cmd(pattern="clone ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    reply_message = await event.get_reply_message()
    replied_user, error_i_a = await get_full_user(event)
    if replied_user is None:
        await event.edit(str(error_i_a))
        return False
    user_id = replied_user.user.id
    profile_pic = await event.client.download_profile_photo(
        user_id, Config.TMP_DOWNLOAD_DIRECTORY)
    # some people have weird HTML in their names
    first_name = html.escape(replied_user.user.first_name)
    # https://stackoverflow.com/a/5072031/4723940
    # some Deleted Accounts do not have first_name
Exemple #10
0
""" Userbot module for purging unneeded messages(usually spam or ot). """

from asyncio import sleep

from telethon.errors import rpcbaseerrors

from Archxbot import BOTLOG, BOTLOG_CHATID, CMD_HELP
from Archxbot.utils import errors_handler, register, Archx_on_cmd


@Archx.on(Archx_on_cmd(pattern="purge$"))
async def fastpurger(purg):
    if purg.fwd_from:
        return
    """ For .purge command, purge all messages starting from the reply. """
    chat = await purg.get_input_chat()
    msgs = []
    count = 0

    async for msg in purg.client.iter_messages(chat, min_id=purg.reply_to_msg_id):
        msgs.append(msg)
        count = count + 1
        msgs.append(purg.reply_to_msg_id)
        if len(msgs) == 100:
            await purg.client.delete_messages(chat, msgs)
            msgs = []

    if msgs:
        await purg.client.delete_messages(chat, msgs)
    done = await purg.client.send_message(
        purg.chat_id,
Exemple #11
0
from Archxbot import CMD_HELP
from Archxbot.utils import Archx_on_cmd

telegraph = Telegraph()
r = telegraph.create_account(short_name=Config.TELEGRAPH_SHORT_NAME)
auth_url = r["auth_url"]

if Config.PRIVATE_GROUP_ID is None:
    BOTLOG = False
else:
    BOTLOG = True
    BOTLOG_CHATID = Config.PRIVATE_GROUP_ID


@Archx.on(Archx_on_cmd(pattern="telegraph (media|text) ?(.*)"))
async def _(event):
    if event.fwd_from:
        return
    if not os.path.isdir(Config.TMP_DOWNLOAD_DIRECTORY):
        os.makedirs(Config.TMP_DOWNLOAD_DIRECTORY)
    if BOTLOG:
        await borg.send_message(
            Config.PRIVATE_GROUP_ID,
            "Created New Telegraph account {} for the current session. \n**Do not give this url to anyone, even if they say they are from Telegram!**"
            .format(auth_url),
        )
    optional_title = event.pattern_match.group(2)
    if event.reply_to_msg_id:
        start = datetime.now()
        r_message = await event.get_reply_message()
Exemple #12
0
                int(snip.media_access_hash),
                snip.media_file_reference,
            )
        else:
            media = None
        message_id = event.message.id
        if event.reply_to_msg_id:
            message_id = event.reply_to_msg_id
        await borg.send_message(event.chat_id,
                                snip.reply,
                                reply_to=message_id,
                                file=media)
        await event.delete()


@Archx.on(Archx_on_cmd("snips (.*)"))
async def on_snip_save(event):
    name = event.pattern_match.group(1)
    msg = await event.get_reply_message()
    if msg:
        snip = {"type": TYPE_TEXT, "text": msg.message or ""}
        if msg.media:
            media = None
            if isinstance(msg.media, types.MessageMediaPhoto):
                media = utils.get_input_photo(msg.media.photo)
                snip["type"] = TYPE_PHOTO
            elif isinstance(msg.media, types.MessageMediaDocument):
                media = utils.get_input_document(msg.media.document)
                snip["type"] = TYPE_DOCUMENT
            if media:
                snip["id"] = media.id
Exemple #13
0
""" Google Text to Speech
Available Commands:
.tts LanguageCode as reply to a message
.tts LangaugeCode | text to speak"""
import asyncio
import os
import subprocess
from datetime import datetime

from gtts import gTTS

from Archxbot import CMD_HELP
from Archxbot.utils import Archx_on_cmd


@Archx.on(Archx_on_cmd(pattern="voice (.*)"))
async def _(event):
    if event.fwd_from:
        return
    input_str = event.pattern_match.group(1)
    start = datetime.now()
    if event.reply_to_msg_id:
        previous_message = await event.get_reply_message()
        text = previous_message.message
        lan = input_str
    elif "|" in input_str:
        lan, text = input_str.split("|")
    else:
        await event.edit("Invalid Syntax. Module stopping.")
        return
    text = text.strip()
Exemple #14
0
"""Restart or Terminate the bot from any chat
Available Commands:
.restart
.shutdown"""
# This Source Code Form is subject to the terms of the GNU
# General Public License, v.3.0. If a copy of the GPL was not distributed with this
# file, You can obtain one at https://www.gnu.org/licenses/gpl-3.0.en.html
import os
import sys

from Archxbot import CMD_HELP
from Archxbot.utils import Archx_on_cmd


@Archx.on(Archx_on_cmd("restart"))
async def _(event):
    if event.fwd_from:
        return
    # 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()

Exemple #15
0
    "\U0001F780-\U0001F7FF"  # Geometric Shapes Extended
    "\U0001F800-\U0001F8FF"  # Supplemental Arrows-C
    "\U0001F900-\U0001F9FF"  # Supplemental Symbols and Pictographs
    "\U0001FA00-\U0001FA6F"  # Chess Symbols
    "\U0001FA70-\U0001FAFF"  # Symbols and Pictographs Extended-A
    "\U00002702-\U000027B0"  # Dingbats
    "]+")


def deEmojify(inputString: str) -> str:
    """Remove emojis and other non-safe characters from string"""
    return re.sub(EMOJI_PATTERN, "", inputString)


# @register(outgoing=True, pattern="^.waifu(?: |$)(.*)", allow_sudo=True))
@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(
Exemple #16
0
import heroku3
import requests
from telegraph import Telegraph

from Archxbot import CMD_HELP
from Archxbot.utils import edit_or_reply, Archx_on_cmd, sudo_cmd

telegraph = Telegraph()
tgnoob = telegraph.create_account(short_name="Archx 🇮🇳")

Heroku = heroku3.from_key(Var.HEROKU_API_KEY)
heroku_api = "https://api.heroku.com"


@Archx.on(
    Archx_on_cmd(pattern="(set|get|del) var(?: |$)(.*)(?: |$)([\s\S]*)", outgoing=True)
)
@Archx.on(
    sudo_cmd(pattern="(set|get|del) var(?: |$)(.*)(?: |$)([\s\S]*)", allow_sudo=True)
)
async def variable(var):
    """
    Manage most of ConfigVars setting, set new var, get current var,
    or delete var...
    """
    if Var.HEROKU_APP_NAME is not None:
        app = Heroku.app(Var.HEROKU_APP_NAME)
    else:
        return await edit_or_reply(
            var, "`[HEROKU]:" "\nPlease setup your` **HEROKU_APP_NAME**"
        )
Exemple #17
0
import re
import urllib

import requests
from bs4 import BeautifulSoup
from PIL import Image

from Archxbot import CMD_HELP, bot
from Archxbot.utils import errors_handler, Archx_on_cmd

opener = urllib.request.build_opener()
useragent = "Mozilla/5.0 (Linux; Android 9; SM-G960F Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.157 Mobile Safari/537.36"
opener.addheaders = [("User-agent", useragent)]


@Archx.on(Archx_on_cmd(pattern=r"reverse(?: |$)(\d*)"))
@errors_handler
async def okgoogle(img):
    """ For .reverse command, Google search images and stickers. """
    if os.path.isfile("okgoogle.png"):
        os.remove("okgoogle.png")

    message = await img.get_reply_message()
    if message and message.media:
        photo = io.BytesIO()
        await bot.download_media(message, photo)
    else:
        await img.edit("`Reply to photo or sticker nigger.`")
        return

    if photo:
Exemple #18
0
from Archxbot import CMD_HELP
from Archxbot.utils import Archx_on_cmd
from var import Var


@Archx.on(Archx_on_cmd(pattern="stat$"))
async def stats(event):
    if event.fwd_from:
        return
    botusername = Var.TG_BOT_USER_NAME_BF_HER
    noob = "stats"
    if event.reply_to_msg_id:
        await event.get_reply_message()
    tap = await bot.inline_query(botusername, noob)
    await tap[0].click(event.chat_id)
    await event.delete()


@Archx.on(Archx_on_cmd(pattern="xogame$"))
async def gamez(event):
    if event.fwd_from:
        return
    botusername = "******"
    noob = "play"
    if event.reply_to_msg_id:
        await event.get_reply_message()
    tap = await bot.inline_query(botusername, noob)
    await tap[0].click(event.chat_id)
    await event.delete()

Exemple #19
0
import asyncio
import os
from pathlib import Path

from Archxbot import CMD_HELP
from Archxbot.function import get_all_modules
from Archxbot.utils import Archx_on_cmd, load_module

DELETE_TIMEOUT = 5


@Archx.on(Archx_on_cmd(pattern="install"))
async def install(event):
    if event.fwd_from:
        return
    if event.reply_to_msg_id:
        sedplugin = await event.get_reply_message()
        try:
            downloaded_file_name = await event.client.download_media(
                sedplugin,
                "Archxbot/modules/",
            )
            if "(" not in downloaded_file_name:
                path1 = Path(downloaded_file_name)
                shortname = path1.stem
                load_module(shortname.replace(".py", ""))
                await event.edit("Archxbot Installed `{}` Sucessfully.".format(
                    os.path.basename(downloaded_file_name)))
            else:
                os.remove(downloaded_file_name)
                await event.edit(
Exemple #20
0
import random
from time import sleep
from urllib.parse import quote_plus

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys

from Archxbot import CHROME_DRIVER, CMD_HELP, GOOGLE_CHROME_BIN
from Archxbot.utils import Archx_on_cmd

CARBONLANG = "auto"
LANG = "en"


@Archx.on(Archx_on_cmd(pattern="carbon"))
async def carbon_api(e):
    if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"):
        """ A Wrapper for carbon.now.sh """
        await e.edit("`Processing..`")
        CARBON = "https://carbon.now.sh/?l={lang}&code={code}"
        global CARBONLANG
        textx = await e.get_reply_message()
        pcode = e.text
        if pcode[8:]:
            pcodee = str(pcode[8:])
            if "|" in pcodee:
                pcode, skeme = pcodee.split("|")
            else:
                pcode = pcodee
                skeme = None
Exemple #21
0
from Archxbot import ALIVE_NAME, CMD_LIST, lang
from Archxbot.utils import Archx_on_cmd

DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "Archxbot"


@Archx.on(Archx_on_cmd(pattern="help ?(.*)"))
async def cmd_list(event):
    if not event.text[0].isalpha() and event.text[0] not in ("/", "#", "@",
                                                             "!"):
        tgbotusername = Var.TG_BOT_USER_NAME_BF_HER
        input_str = event.pattern_match.group(1)
        if tgbotusername is None or input_str == "text":
            string = ""
            for i in CMD_LIST:
                string += "ℹ️ " + i + "\n"
                for iter_list in CMD_LIST[i]:
                    string += "    `" + str(iter_list) + "`"
                    string += "\n"
                string += "\n"
            if len(string) > 4095:
                await borg.send_message(event.chat_id, "Do .help cmd")
                await asyncio.sleep(5)
            else:
                await event.edit(string)
        elif input_str:
            if input_str in CMD_LIST:
                string = "Commands found in {}:\n".format(input_str)
                for i in CMD_LIST[input_str]:
                    string += "    " + i
                    string += "\n"
Exemple #22
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 #23
0
"""Emoji
Available Commands:
.support
"""

import asyncio

from Archxbot import CMD_HELP
from Archxbot.utils import Archx_on_cmd


@Archx.on(Archx_on_cmd("Archxbot"))
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 == "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])

Exemple #24
0
""" Google Translate
Available Commands:
.tr LanguageCode as reply to a message
.tr LangaugeCode | text to translate"""

import requests
from google_trans_new import google_translator
from googletrans import LANGUAGES
from langdetect import detect

from Archxbot import CMD_HELP
from Archxbot.utils import edit_or_reply, Archx_on_cmd, sudo_cmd


@Archx.on(Archx_on_cmd("tr ?(.*)"))
@Archx.on(sudo_cmd("tr ?(.*)", allow_sudo=True))
async def _(event):
    if event.fwd_from:
        return
    if "trim" in event.raw_text:
        return
    input_str = event.pattern_match.group(1)
    if event.reply_to_msg_id:
        previous_message = await event.get_reply_message()
        text = previous_message.message
        lan = input_str or "en"
    elif "|" in input_str:
        lan, text = input_str.split("|")
    else:
        await edit_or_reply(event, "`.tr LanguageCode` as reply to a message")
        return
Exemple #25
0
            if seconds == 0 and remainder == 0:
                break
            time_list.append(int(result))
            seconds = int(remainder)

        for x in range(len(time_list)):
            time_list[x] = str(time_list[x]) + time_suffix_list[x]
        if len(time_list) == 4:
            ping_time += time_list.pop() + ", "

        time_list.reverse()
        ping_time += ":".join(time_list)

        return ping_time

    @Archx.on(Archx_on_cmd(pattern="ping$"))
    async def _(event):
        starkislub = await edit_or_reply(event, "`Pong !`")
        if event.fwd_from:
            return
        start = datetime.now()
        end = datetime.now()
        ms = (end - start).microseconds / 1000
        uptime = get_readable_time((time.time() - Lastupdate))
        await starkislub.edit(
            f"**🙈ව�ඩ ව�ඩ මහත්තය�⚙🔧** \n **�ʸ ᶜᵘʳʳᵉ�ᵗ ᵖᶦ��ʳᵃᵗᵉ**👇 \n \n ⚡� `{ms}` \n ⚡� `{uptime}`"
        )


else: