From 7e1b8cc42b9519677c368ffd59f19d9f698da975 Mon Sep 17 00:00:00 2001 From: Tofik Denianto <77754555+tofikdn@users.noreply.github.com> Date: Mon, 13 Sep 2021 21:21:10 +0700 Subject: [PATCH 1/2] Update requirements.txt --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 256a4d1..d91faa6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ pathlib tgcrypto +uvloop asyncio ffmpeg-python googletrans==4.0.0rc1 @@ -18,4 +19,4 @@ requests psutil future gTTS -wget \ No newline at end of file +wget From 9fb370e0599b29d0cbc682cf00e5e705e2ad3634 Mon Sep 17 00:00:00 2001 From: Tofik Denianto <77754555+tofikdn@users.noreply.github.com> Date: Mon, 13 Sep 2021 21:42:36 +0700 Subject: [PATCH 2/2] Update __main__.py to increase general speed and stability --- bot/__main__.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/bot/__main__.py b/bot/__main__.py index f078a89..1e37b9a 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -5,6 +5,7 @@ import logging import time import sys import asyncio +import uvloop import glob import importlib from pathlib import Path @@ -30,6 +31,7 @@ loop = asyncio.get_event_loop() _path = f"bot/*.py" files = glob.glob(_path) + def load_plugins(plugin_name): path = Path(f"bot/{plugin_name}.py") name = "bot.{}".format(plugin_name) @@ -39,6 +41,7 @@ def load_plugins(plugin_name): sys.modules[f"bot." + plugin_name] = load print("Imported => " + plugin_name) + async def start(): print('\n') print('------------------- Initalizing VC BOT ---------------------') @@ -59,16 +62,10 @@ async def start(): print(' and Bot =>> {}'.format((await bot.get_me()).first_name)) print('-----------------------------------------------------') await idle() -if __name__ == '__main__': + print('[INFO]: STOPPING BOT') + + +if __name__ == "__main__": + uvloop.install() is_bot = bool(Veez.BOT_TOKEN) loop.run_until_complete(start()) - - -# bot.start() -# print("[STATUS]:✅ »» BOT CLIENT STARTED ««") -# app.start() -# print("[STATUS]:✅ »» USERBOT CLIENT STARTED ««") -# call_py.start() -# print("[STATUS]:✅ »» PYTGCALLS CLIENT STARTED ««") -# idle() -# print("[STATUS]:❌ »» BOT STOPPED ««")