Browse Source

Some fixes

TheHamkerCat 5 years ago
parent
commit
027eea8d12
6 changed files with 12 additions and 9 deletions
  1. 0 1
      requirements.txt
  2. 4 2
      wbb/__init__.py
  3. 5 1
      wbb/__main__.py
  4. 1 2
      wbb/modules/chat_watcher.py
  5. 0 1
      wbb/modules/taglogger.py
  6. 2 2
      wbb/utils/functions.py

+ 0 - 1
requirements.txt

@@ -5,7 +5,6 @@ gTTS
 cryptography
 dnspython
 future
-googletrans==4.0.0-rc1
 motor
 pillow
 psutil

+ 4 - 2
wbb/__init__.py

@@ -163,12 +163,14 @@ def get_info(app, app2):
     ] + SPAM_CHECK_EXCEPTION_GROUPS
 
 
-print("[INFO]: STARTING BOT CLIENT")
+print("[INFO]: STARTING BOT CLIENT TEMPORARILY")
 app.start()
-print("[INFO]: STARTING USERBOT CLIENT")
+print("[INFO]: STARTING USERBOT CLIENT TEMPORARILY")
 app2.start()
 print("[INFO]: LOADING UB/BOT PROFILE INFO")
 get_info(app, app2)
 print("[INFO]: LOADED UB/BOT PROFILE INFO")
 if USERBOT_ID not in SUDOERS:
     SUDOERS.append(USERBOT_ID)
+app.stop()
+app2.stop()

+ 5 - 1
wbb/__main__.py

@@ -30,7 +30,7 @@ from pyrogram import filters, idle
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
 
 from wbb import (BOT_NAME, BOT_USERNAME, USERBOT_NAME, aiohttpsession,
-                 app)
+                 app, app2)
 from wbb.modules import ALL_MODULES
 from wbb.modules.sudoers import bot_sys_stats
 from wbb.utils import paginate_modules
@@ -42,6 +42,10 @@ HELPABLE = {}
 
 
 async def start_bot():
+    print("[INFO]: STARTING BOT CLIENT")
+    await app.start()
+    print("[INFO]: STARTING USERBOT CLIENT")
+    await app2.start()
     restart_data = await clean_restart_stage()
     if restart_data:
         print("[INFO]: SENDING RESTART STATUS")

+ 1 - 2
wbb/modules/chat_watcher.py

@@ -23,8 +23,7 @@ SOFTWARE.
 """
 from wbb import app
 from wbb.utils.dbfunctions import (add_served_chat, add_served_user,
-                                   blacklisted_chats, is_served_chat,
-                                   is_served_user)
+                                   blacklisted_chats)
 from wbb.utils.filter_groups import chat_watcher_group
 
 

+ 0 - 1
wbb/modules/taglogger.py

@@ -27,7 +27,6 @@ from pyrogram.types import InlineKeyboardButton, Message
 
 from wbb import (BOT_ID, LOG_GROUP_ID, LOG_MENTIONS, USERBOT_ID,
                  USERBOT_NAME, USERBOT_USERNAME, app, app2)
-from wbb.core.decorators.errors import capture_err
 from wbb.utils.filter_groups import taglog_group
 
 IS_USERBOT_ONLINE = False

+ 2 - 2
wbb/utils/functions.py

@@ -141,7 +141,7 @@ async def make_carbon(code):
 
 
 async def transfer_sh(file_or_message):
-    if is_instance(file_or_message, Message):
+    if isinstance(file_or_message, Message):
         file_or_message = await file_or_message.download()
     file = file_or_message
     async with aiofiles.open(file, "rb") as f:
@@ -276,7 +276,7 @@ async def test_ARQ(message):
             if result.ok:
                 results += f"**{key.capitalize()}:** `{t2-t1}`\n"
             else:
-                resuls += f"**{key.capitalize()}:** `Failed`\n"
+                results += f"**{key.capitalize()}:** `Failed`\n"
         except Exception:
             results += f"**{key.capitalize()}:** `Failed`\n"
     return results