ポキ 5 éve
szülő
commit
26ddff6c71

+ 3 - 1
requirements.txt

@@ -1,2 +1,4 @@
 psutil
-shutil
+shutil
+pyrogram==1.0.7
+TgCrypto

+ 14 - 0
sample_config.ini

@@ -0,0 +1,14 @@
+[pyrogram]
+bot_token =
+api_id =
+api_hash =
+
+[admin]
+owner_id =
+
+[prefix]
+prefixes = / !
+
+[mods]
+load_modules = 
+noload_modules = 

+ 47 - 0
wbb/__init__.py

@@ -0,0 +1,47 @@
+from pyrogram import Client
+from configparser import ConfigParser
+import logging
+import os
+
+
+if os.path.exists("wbb/logs/error.log"):
+    f = open("wbb/logs/error.log", "w")
+    f.write("PEAK OF LOG FILE")
+
+LOG_FORMAT = (
+    "[%(asctime)s.%(msecs)03d] %(filename)s:%(lineno)s %(levelname)s: %(message)s"
+)
+
+logging.basicConfig(
+    level=logging.INFO,
+    format=LOG_FORMAT,
+    datefmt="%m-%d %H:%M",
+    filename="wbb/logs/error.log",
+    filemode="w",
+)
+
+console = logging.StreamHandler()
+console.setLevel(logging.ERROR)
+formatter = logging.Formatter(LOG_FORMAT)
+console.setFormatter(formatter)
+logging.getLogger("").addHandler(console)
+
+log = logging.getLogger()
+
+config = ConfigParser()
+config.read("config.ini")
+OWNER_ID = config.get("admin", "owner_id")
+Command = config.get("prefix", "prefixes").split()
+MOD_LOAD = config.get("mods", "load_modules").split()
+MOD_NOLOAD = config.get("mods", "noload_modules").split()
+
+
+app = Client(
+    ":memory:"
+)
+
+
+
+
+
+

+ 174 - 2
wbb/__main__.py

@@ -1,4 +1,176 @@
-from .wbb import app
+import asyncio
+import re
+from pyrogram import filters, idle
+from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
+from wbb import app, MOD_NOLOAD, MOD_LOAD, Command
+from wbb.utils import random_line, get_info, paginate_modules, cust_filter
+import importlib
+from wbb.modules import ALL_MODULES
+import uvloop
+
+
+loop = asyncio.get_event_loop()
+
+HELPABLE = {}
+
+async def start_bot():
+    await app.start()
+    await get_info(app)
+    from wbb.utils import botinfo
+
+    await main_bot()
+    for modul in ALL_MODULES:
+        imported_module = importlib.import_module("wbb.modules." + modul)
+        if hasattr(imported_module, "__MODULE__") and imported_module.__MODULE__:
+            if imported_module.__MODULE__.lower() in MOD_NOLOAD:
+                continue
+            imported_module.__MODULE__ = imported_module.__MODULE__
+            if hasattr(imported_module, "__HELP__") and imported_module.__HELP__:
+                HELPABLE[imported_module.__MODULE__.lower()] = imported_module
+    bot_modules = ""
+    j = 1
+    for i in ALL_MODULES:
+        if j == 4:
+            bot_modules += "|{:<15}|\n".format(i)
+            j = 0
+        else:
+            bot_modules += "|{:<15}".format(i)
+        j += 1
+    print("+===============================================================+")
+    print("|                         WBB - Modules                         |")
+    print("+===============+===============+===============+===============+")
+    print(bot_modules)
+    print("+===============+===============+===============+===============+")
+    print("Bot run successfully as {}!".format(botinfo.BOT_NAME))
+    await idle()
+
+
+async def main_bot():
+    from wbb.utils import botinfo
+
+    @app.on_message(cust_filter.command("start"))
+    async def start(client, message):
+        if message.chat.type != "private":
+            await message.reply("Message me Privately *winks*")
+            return
+        await message.reply(
+            "Hi, try /help"
+        )
+
+    @app.on_message(cust_filter.command("help"))
+    async def help_command(_, message):
+        if message.chat.type != "private":
+            if len(message.command) >= 2 and message.command[1] == "help":
+                text, keyboard = await help_parser(message)
+                await message.reply(
+                    text, reply_markup=keyboard, disable_web_page_preview=True
+                )
+                return
+            keyboard = InlineKeyboardMarkup(
+                [
+                    [
+                        InlineKeyboardButton(
+                            text="Help",
+                            url="t.me/" + botinfo.BOT_USERNAME + "?start=help",
+                        )
+                    ]
+                ]
+            )
+            await message.reply("Contact me at PM.", reply_markup=keyboard)
+            return
+        text, keyboard = await help_parser(message)
+        await message.reply(text, reply_markup=keyboard, disable_web_page_preview=True)
+
+    async def help_parser(message, keyboard=None):
+        if not keyboard:
+            keyboard = InlineKeyboardMarkup(paginate_modules(0, HELPABLE, "help"))
+        return (
+            "Hi {first_name}. I am {bot_name}, you can use commands with following prefixes{commands}".format(
+                first_name=message.from_user.first_name,
+                bot_name=botinfo.BOT_NAME,
+                commands=", ".join(Command),
+            ),
+            keyboard,
+        )
+
+    @app.on_callback_query(filters.regex(r"help_(.*?)"))
+    async def help_button(c, q):
+        mod_match = re.match(r"help_module\((.+?)\)", q.data)
+        prev_match = re.match(r"help_prev\((.+?)\)", q.data)
+        next_match = re.match(r"help_next\((.+?)\)", q.data)
+        back_match = re.match(r"help_back", q.data)
+        create_match = re.match(r"help_create", q.data)
+
+        if mod_match:
+            module = mod_match.group(1)
+            text = "{} **{}**:\n".format(
+                "Here is the help for", HELPABLE[module].__MODULE__
+            ) + HELPABLE[module].__HELP__
+
+            await q.message.edit(
+                text=text,
+                reply_markup=InlineKeyboardMarkup(
+                    [
+                        [
+                            InlineKeyboardButton(
+                                "back", callback_data="help_back"
+                            )
+                        ]
+                    ]
+                ),
+                disable_web_page_preview=True,
+            )
+
+        elif prev_match:
+            curr_page = int(prev_match.group(1))
+            await q.message.edit(
+                text="Hi {first_name}. I am {bot_name}, you can use commands with following prefixes{commands}".format(
+                    first_name=q.from_user.first_name,
+                    bot_name=botinfo.BOT_NAME,
+                    commands=", ".join(Command),
+                ),
+                reply_markup=InlineKeyboardMarkup(
+                    paginate_modules(curr_page - 1, HELPABLE, "help")
+                ),
+                disable_web_page_preview=True,
+            )
+
+        elif next_match:
+            next_page = int(next_match.group(1))
+            await q.message.edit(
+                text="Hi {first_name}. I am {bot_name}, you can use commands with following prefixes{commands}".format(
+                    first_name=q.from_user.first_name,
+                    bot_name=botinfo.BOT_NAME,
+                    commands=", ".join(Command),
+                ),
+                reply_markup=InlineKeyboardMarkup(
+                    paginate_modules(next_page + 1, HELPABLE, "help")
+                ),
+                disable_web_page_preview=True,
+            )
+
+        elif back_match:
+            await q.message.edit(
+                text="Hi {first_name}. I am {bot_name}, you can use commands with following prefixes{commands}".format(
+                    first_name=q.from_user.first_name,
+                    bot_name=botinfo.BOT_NAME,
+                    commands=", ".join(Command),
+                ),
+                reply_markup=InlineKeyboardMarkup(
+                    paginate_modules(0, HELPABLE, "help")
+                ),
+                disable_web_page_preview=True,
+            )
+
+        elif create_match:
+            text, keyboard = await help_parser(q)
+            await q.message.edit(
+                text=text, reply_markup=keyboard, disable_web_page_preview=True
+            )
+
+        return await c.answer_callback_query(q.id)
+
 
 if __name__ == "__main__":
-    app.run()
+    uvloop.install()
+    loop.run_until_complete(start_bot())

+ 0 - 0
wbb/logs/README.md


+ 59 - 0
wbb/logs/error.log

@@ -0,0 +1,59 @@
+PEAK OF LOG FILE] __init__.py:42 INFO: Modules loaded: ['commit', 'greetings', 'ping', 'stats']
+[12-16 14:16.948] auth.py:81 INFO: Start creating a new auth key on DC2
+[12-16 14:16.948] connection.py:54 INFO: Connecting...
+[12-16 14:16.181] connection.py:65 INFO: Connected! Production DC2 - IPv4 - TCPAbridgedO
+[12-16 14:17.623] auth.py:248 INFO: Done auth key exchange: DhGenOk
+[12-16 14:17.624] connection.py:74 INFO: Disconnected
+[12-16 14:17.627] connection.py:54 INFO: Connecting...
+[12-16 14:17.862] connection.py:65 INFO: Connected! Production DC2 - IPv4 - TCPAbridgedO
+[12-16 14:17.862] session.py:345 INFO: NetworkTask started
+[12-16 14:17.382] msg_id.py:45 INFO: Time synced: 2020-12-16 09:17:01.268164 UTC
+[12-16 14:17.622] session.py:314 INFO: NextSaltTask started
+[12-16 14:17.623] session.py:326 INFO: Next salt in 44m 58s (2020-12-16 15:02:00)
+[12-16 14:17.943] session.py:168 INFO: Session initialized: Layer 117
+[12-16 14:17.943] session.py:169 INFO: Device: CPython 3.7.3 - Pyrogram 1.0.7
+[12-16 14:17.943] session.py:170 INFO: System: Linux 5.4.70-amd64-desktop (EN)
+[12-16 14:17.943] session.py:185 INFO: Session started
+[12-16 14:17.944] session.py:292 INFO: PingTask started
+[12-16 14:17.212] session.py:311 INFO: PingTask stopped
+[12-16 14:17.212] session.py:342 INFO: NextSaltTask stopped
+[12-16 14:17.212] connection.py:74 INFO: Disconnected
+[12-16 14:17.213] session.py:361 INFO: NetworkTask stopped
+[12-16 14:17.213] session.py:216 INFO: Session stopped
+[12-16 14:17.215] auth.py:81 INFO: Start creating a new auth key on DC5
+[12-16 14:17.215] connection.py:54 INFO: Connecting...
+[12-16 14:17.272] connection.py:65 INFO: Connected! Production DC5 - IPv4 - TCPAbridgedO
+[12-16 14:17.922] auth.py:248 INFO: Done auth key exchange: DhGenOk
+[12-16 14:17.922] connection.py:74 INFO: Disconnected
+[12-16 14:17.924] connection.py:54 INFO: Connecting...
+[12-16 14:17.982] connection.py:65 INFO: Connected! Production DC5 - IPv4 - TCPAbridgedO
+[12-16 14:17.982] session.py:345 INFO: NetworkTask started
+[12-16 14:17.242] session.py:314 INFO: NextSaltTask started
+[12-16 14:17.243] session.py:326 INFO: Next salt in 44m 59s (2020-12-16 15:02:02)
+[12-16 14:17.336] session.py:168 INFO: Session initialized: Layer 117
+[12-16 14:17.337] session.py:169 INFO: Device: CPython 3.7.3 - Pyrogram 1.0.7
+[12-16 14:17.337] session.py:170 INFO: System: Linux 5.4.70-amd64-desktop (EN)
+[12-16 14:17.337] session.py:185 INFO: Session started
+[12-16 14:17.337] session.py:292 INFO: PingTask started
+[12-16 14:17.512] dispatcher.py:122 INFO: Started 8 HandlerTasks
+[12-16 14:17.513] syncer.py:88 INFO: Synced ":memory:" in 0.695229 ms
+[12-16 14:17.514] syncer.py:88 INFO: Synced ":memory:" in 0.599384 ms
+[12-16 14:17.517] syncer.py:88 INFO: Synced ":memory:" in 0.4282 ms
+[12-16 14:18.518] syncer.py:88 INFO: Synced ":memory:" in 0.440359 ms
+[12-16 14:18.520] syncer.py:88 INFO: Synced ":memory:" in 0.711679 ms
+[12-16 14:18.522] syncer.py:88 INFO: Synced ":memory:" in 0.425577 ms
+[12-16 14:19.525] syncer.py:88 INFO: Synced ":memory:" in 0.70262 ms
+[12-16 14:19.526] syncer.py:88 INFO: Synced ":memory:" in 0.418901 ms
+[12-16 14:19.527] syncer.py:88 INFO: Synced ":memory:" in 0.478506 ms
+[12-16 14:20.529] syncer.py:88 INFO: Synced ":memory:" in 0.4282 ms
+[12-16 14:20.530] syncer.py:88 INFO: Synced ":memory:" in 0.533581 ms
+[12-16 14:20.532] syncer.py:88 INFO: Synced ":memory:" in 0.680923 ms
+[12-16 14:21.533] syncer.py:88 INFO: Synced ":memory:" in 0.426531 ms
+[12-16 14:21.535] syncer.py:88 INFO: Synced ":memory:" in 0.423193 ms
+[12-16 14:21.536] syncer.py:88 INFO: Synced ":memory:" in 0.436306 ms
+[12-16 14:22.537] syncer.py:88 INFO: Synced ":memory:" in 0.441074 ms
+[12-16 14:22.539] syncer.py:88 INFO: Synced ":memory:" in 0.504732 ms
+[12-16 14:22.541] syncer.py:88 INFO: Synced ":memory:" in 0.596285 ms
+[12-16 14:23.542] syncer.py:88 INFO: Synced ":memory:" in 0.424623 ms
+[12-16 14:23.544] syncer.py:88 INFO: Synced ":memory:" in 0.546932 ms
+[12-16 14:23.970] idle.py:71 INFO: Stop signal received (2). Exiting...

+ 43 - 0
wbb/modules/__init__.py

@@ -0,0 +1,43 @@
+import importlib
+from wbb import MOD_LOAD, MOD_NOLOAD, log
+
+def __list_all_modules():
+    from os.path import dirname, basename, isfile
+    import glob
+    # This generates a list of modules in this folder for the * in __main__ to work.
+    mod_paths = glob.glob(dirname(__file__) + "/*.py")
+    all_modules = [
+        basename(f)[:-3]
+        for f in mod_paths
+        if isfile(f)
+        and f.endswith(".py")
+        and not f.endswith("__init__.py")
+        and not f.endswith("__main__.py")
+    ]
+
+    if MOD_LOAD or MOD_NOLOAD:
+        to_Load = MOD_LOAD
+        if to_Load:
+            if not all(
+                any(mod == module_name for module_name in all_modules)
+                for mod in to_Load
+            ):
+                log.error("Invalid Module name!")
+                quit(1)
+
+        else:
+            to_Load = all_modules
+
+        if MOD_NOLOAD:
+            log.info("No load: {}".format(MOD_NOLOAD))
+            return [item for item in to_Load if item not in MOD_NOLOAD]
+
+        return to_Load
+
+    return all_modules
+
+
+importlib.import_module("wbb.modules.__main__")
+ALL_MODULES = sorted(__list_all_modules())
+log.info("Modules loaded: %s", str(ALL_MODULES))
+__all__ = ALL_MODULES + ["ALL_MODULES"]

+ 8 - 0
wbb/modules/__main__.py

@@ -0,0 +1,8 @@
+# Group for filters
+# group=1 = Check flood
+# group=2 = Filter
+# group=3 = locks
+# group=4 = Blacklist
+# group=5 = Blacklist sticker
+# group=6 = AFK & reply AFK
+# group=10 = logging users

BIN
wbb/modules/__pycache__/__init__.cpython-37.pyc


BIN
wbb/modules/__pycache__/__main__.cpython-37.pyc


BIN
wbb/modules/__pycache__/commit.cpython-37.pyc


BIN
wbb/modules/__pycache__/greetings.cpython-37.pyc


BIN
wbb/modules/__pycache__/help.cpython-37.pyc


BIN
wbb/modules/__pycache__/ping.cpython-37.pyc


BIN
wbb/modules/__pycache__/stats.cpython-37.pyc


+ 11 - 0
wbb/modules/commit.py

@@ -0,0 +1,11 @@
+from wbb import app
+from pyrogram import filters
+from wbb.utils import cust_filter, random_line
+
+__MODULE__ = "Commit"
+__HELP__ = "A Fun little module, try /commit uwu"
+
+
+@app.on_message(cust_filter.command(commands=(["commit"])))
+async def commit(client, message):
+    await message.reply_text(random_line('wbb/commit.txt'))

+ 13 - 0
wbb/modules/greetings.py

@@ -0,0 +1,13 @@
+from wbb import app
+from pyrogram import filters, emoji
+
+__MODULE__ = "Greetings"
+__HELP__ = "Welcomes Users to the Group"
+
+MESSAGE = "{} Welcome {}!" 
+
+@app.on_message(filters.new_chat_members)
+async def welcome(client, message):
+    new_members = [i.mention for i in message.new_chat_members]
+    text = MESSAGE.format(emoji.CROWN, ", ".join(new_members))
+    await message.reply_text(text, disable_web_page_preview=True)

+ 13 - 0
wbb/modules/ping.py

@@ -0,0 +1,13 @@
+from wbb import app
+import time
+from wbb.utils import cust_filter
+
+__MODULE__ = "Ping"
+__HELP__ = " - /ping - to check if I am Alive or Not"
+
+@app.on_message(cust_filter.command(commands = (["ping"])))
+async def ping(client, message):
+    start_time = int(round(time.time() * 1000))
+    m = await message.reply_text("Starting Ping")
+    end_time = int(round(time.time() * 1000))
+    await m.edit(f'{end_time - start_time} ms')

+ 17 - 0
wbb/modules/stats.py

@@ -0,0 +1,17 @@
+from wbb import app
+from pyrogram import filters
+import psutil
+from wbb.utils import cust_filter
+
+__MODULE__ = "Stats"
+__HELP__ = "For Bot Owner to Check system Status"
+
+@app.on_message(cust_filter.command(commands=(["stats"])))
+async def stats(client, message):
+    cpu = psutil.cpu_percent(interval=0.5)
+    mem = psutil.virtual_memory().percent
+    disk = psutil.disk_usage('/').percent
+    stats = f'<b>CPU:</b> {cpu}% ' \
+            f'<b>RAM:</b> {mem}% ' \
+            f'<b>Disk:</b> {disk}%'
+    await message.reply_text(stats)

+ 0 - 4
wbb/sample_config.ini

@@ -1,4 +0,0 @@
-[pyrogram]
-bot_token=
-api_id =
-api_hash =

+ 3 - 0
wbb/utils/__init__.py

@@ -0,0 +1,3 @@
+from .read_lines import random_line
+from .botinfo import get_info
+from .misc import paginate_modules

BIN
wbb/utils/__pycache__/__init__.cpython-37.pyc


BIN
wbb/utils/__pycache__/botinfo.cpython-37.pyc


BIN
wbb/utils/__pycache__/cust_filter.cpython-37.pyc


BIN
wbb/utils/__pycache__/misc.cpython-37.pyc


BIN
wbb/utils/__pycache__/read_lines.cpython-37.pyc


+ 16 - 0
wbb/utils/botinfo.py

@@ -0,0 +1,16 @@
+BOT_ID = 0
+BOT_NAME = ""
+BOT_USERNAME = ""
+BOT_DC_ID = 0
+
+
+async def get_info(app):
+    global BOT_ID, BOT_NAME, BOT_USERNAME, BOT_DC_ID
+    getme = await app.get_me()
+    BOT_ID = getme.id
+    if getme.last_name:
+        BOT_NAME = getme.first_name + " " + getme.last_name
+    else:
+        BOT_NAME = getme.first_name
+    BOT_USERNAME = getme.username
+    BOT_DC_ID = getme.dc_id

+ 65 - 0
wbb/utils/cust_filter.py

@@ -0,0 +1,65 @@
+import shlex
+from typing import List
+import re
+
+from pyrogram.filters import create
+from pyrogram.types import Message
+
+from wbb import Command
+from wbb.utils.botinfo import BOT_USERNAME
+
+
+def command(
+    commands: str or List[str],
+    prefixes: str or List[str] = "/",
+    case_sensitive: bool = False,
+):
+    """
+    This is a drop in replacement for the default cust_filter.command that is included
+    in Pyrogram. The Pyrogram one does not support /command@botname type commands,
+    so this custom filter enables that throughout all groups and private chats.
+    This filter works exactly the same as the original command filter even with support for multiple command
+    prefixes and case sensitivity.
+    Command arguments are given to user as message.command
+    """
+
+    async def func(flt, _, message: Message):
+        text: str = message.text or message.caption
+        message.command = None
+
+        if not text:
+            return False
+
+        regex = "^({prefix})+\\b({regex})\\b(\\b@{bot_name}\\b)?(.*)".format(
+            prefix="|".join(re.escape(x) for x in Command),
+            regex="|".join(flt.commands).lower(),
+            bot_name=BOT_USERNAME,
+        )
+
+        matches = re.search(re.compile(regex), text.lower())
+        if matches:
+            message.command = [matches.group(2)]
+            try:
+                for arg in shlex.split(matches.group(4).strip()):
+                    if arg == BOT_USERNAME:
+                        continue
+                    message.command.append(arg)
+            except ValueError:
+                return True
+            return True
+        return False
+
+    commands = commands if type(commands) is list else [commands]
+    commands = {c if case_sensitive else c.lower() for c in commands}
+
+    prefixes = [] if prefixes is None else prefixes
+    prefixes = prefixes if type(prefixes) is list else [prefixes]
+    prefixes = set(prefixes) if prefixes else {""}
+
+    return create(
+        func,
+        "CustomCommandFilter",
+        commands=commands,
+        prefixes=prefixes,
+        case_sensitive=case_sensitive,
+    )

+ 85 - 0
wbb/utils/misc.py

@@ -0,0 +1,85 @@
+import re
+
+# import requests
+from math import ceil
+
+from pyrogram.types import InlineKeyboardButton
+from wbb import MOD_LOAD, MOD_NOLOAD
+
+
+def cleanhtml(raw_html):
+    cleanr = re.compile("<.*?>")
+    return re.sub(cleanr, "", raw_html)
+
+
+class EqInlineKeyboardButton(InlineKeyboardButton):
+    def __eq__(self, other):
+        return self.text == other.text
+
+    def __lt__(self, other):
+        return self.text < other.text
+
+    def __gt__(self, other):
+        return self.text > other.text
+
+
+def paginate_modules(page_n, module_dict, prefix, chat=None):
+    if not chat:
+        modules = sorted(
+            [
+                EqInlineKeyboardButton(
+                    x.__MODULE__,
+                    callback_data="{}_module({})".format(prefix, x.__MODULE__.lower()),
+                )
+                for x in module_dict.values()
+            ]
+        )
+    else:
+        modules = sorted(
+            [
+                EqInlineKeyboardButton(
+                    x.__MODULE__,
+                    callback_data="{}_module({},{})".format(
+                        prefix, chat, x.__MODULE__.lower()
+                    ),
+                )
+                for x in module_dict.values()
+            ]
+        )
+
+    pairs = list(zip(modules[::3], modules[1::3], modules[2::3]))
+    c = 0
+    for x in pairs:
+        for _ in x:
+            c += 1
+    if len(modules) - c == 1:
+        pairs.append((modules[-1],))
+    elif len(modules) - c == 2:
+        pairs.append(
+            (
+                modules[-2],
+                modules[-1],
+            )
+        )
+
+    max_num_pages = ceil(len(pairs) / 7)
+    modulo_page = page_n % max_num_pages
+
+    # can only have a certain amount of buttons side by side
+    if len(pairs) > 7:
+        pairs = pairs[modulo_page * 7 : 7 * (modulo_page + 1)] + [
+            (
+                EqInlineKeyboardButton(
+                    "<", callback_data="{}_prev({})".format(prefix, modulo_page)
+                ),
+                EqInlineKeyboardButton(
+                    ">", callback_data="{}_next({})".format(prefix, modulo_page)
+                ),
+            )
+        ]
+
+    return pairs
+
+
+def is_module_loaded(name):
+    return (not MOD_LOAD or name in MOD_LOAD) and name not in MOD_NOLOAD

+ 4 - 0
wbb/utils/read_lines.py

@@ -0,0 +1,4 @@
+import random
+
+async def random_line(fname):
+    return random.choice(open(fname).read().splitlines())

+ 0 - 50
wbb/wbb.py

@@ -1,50 +0,0 @@
-from pyrogram import Client, filters, emoji, types
-import random
-import time
-import shutil, psutil
-
-app = Client("WilliamButcher")
-
-
-def random_line(fname):
-    lines = open(fname).read().splitlines()
-    return random.choice(lines)
-
-@app.on_message(filters.command(commands = (["start"])))
-async def start(client, message):
-    await message.reply_text(random_line('wbb/start.txt'))
-
-@app.on_message(filters.command(commands = (["commit"])))
-async def commit(client, message):
-    await message.reply_text(random_line('wbb/commit.txt'))
-
-
-@app.on_message(filters.command(commands = (["ping"])))
-def ping(client, message):
-    start_time = int(round(time.time() * 1000))
-    message.reply_text("Starting Ping")
-    end_time = int(round(time.time() * 1000))
-    message.reply_text(f'{end_time - start_time} ms')     #Need to edit the above message instead of sending another
-
-
-@app.on_message(filters.command(commands =(["stats"])))
-def stats(client, message):
-    cpu = psutil.cpu_percent(interval=0.5)
-    mem = psutil.virtual_memory().percent
-    disk = psutil.disk_usage('/').percent
-    stats = f'<b>CPU:</b> {cpu}% ' \
-            f'<b>RAM:</b> {mem}% ' \
-            f'<b>Disk:</b> {disk}%'
-    message.reply_text(stats)
-
-
-
-
-MESSAGE = "{} Welcome {}!" 
-
-@app.on_message(filters.new_chat_members)
-def welcome(client, message):
-    new_members = [i.mention for i in message.new_chat_members]
-    text = MESSAGE.format(emoji.CROWN, ", ".join(new_members))
-    message.reply_text(text, disable_web_page_preview=True)
-