thehamkercat 5 лет назад
Родитель
Сommit
540f508d63
53 измененных файлов с 192 добавлено и 566 удалено
  1. 1 3
      sample_config.py
  2. 2 1
      wbb/__init__.py
  3. 6 21
      wbb/__main__.py
  4. 0 1
      wbb/core/decorators/errors.py
  5. 3 9
      wbb/core/types/InlineQueryResult.py
  6. 24 68
      wbb/modules/admin.py
  7. 3 11
      wbb/modules/admin_misc.py
  8. 0 1
      wbb/modules/alive.py
  9. 10 17
      wbb/modules/anime.py
  10. 1 4
      wbb/modules/antiservice.py
  11. 0 1
      wbb/modules/arq.py
  12. 5 16
      wbb/modules/blacklist.py
  13. 0 1
      wbb/modules/blacklist_chat.py
  14. 0 1
      wbb/modules/carbon.py
  15. 6 23
      wbb/modules/chatbot.py
  16. 2 7
      wbb/modules/couple.py
  17. 1 4
      wbb/modules/covid.py
  18. 2 11
      wbb/modules/devs.py
  19. 4 14
      wbb/modules/filters.py
  20. 1 4
      wbb/modules/genstr.py
  21. 1 4
      wbb/modules/global_stats.py
  22. 6 19
      wbb/modules/greetings.py
  23. 1 4
      wbb/modules/images.py
  24. 2 1
      wbb/modules/info.py
  25. 18 54
      wbb/modules/inline.py
  26. 13 11
      wbb/modules/karma.py
  27. 3 11
      wbb/modules/locks.py
  28. 10 15
      wbb/modules/misc.py
  29. 4 13
      wbb/modules/music.py
  30. 6 22
      wbb/modules/notes.py
  31. 2 7
      wbb/modules/paste.py
  32. 1 6
      wbb/modules/pipes.py
  33. 4 13
      wbb/modules/pmpermit.py
  34. 2 7
      wbb/modules/quotly.py
  35. 0 1
      wbb/modules/reddit.py
  36. 1 4
      wbb/modules/regex.py
  37. 3 10
      wbb/modules/repo.py
  38. 2 7
      wbb/modules/reverse.py
  39. 3 10
      wbb/modules/rice.py
  40. 2 8
      wbb/modules/stickers.py
  41. 4 10
      wbb/modules/sudo.py
  42. 8 25
      wbb/modules/sudoers.py
  43. 1 4
      wbb/modules/telegraph.py
  44. 0 1
      wbb/modules/tts.py
  45. 1 4
      wbb/modules/userbot.py
  46. 0 1
      wbb/modules/webss.py
  47. 4 12
      wbb/utils/aiodownloader/downloader.py
  48. 3 11
      wbb/utils/dbfunctions.py
  49. 1 2
      wbb/utils/files.py
  50. 0 1
      wbb/utils/functions.py
  51. 13 40
      wbb/utils/inlinefuncs.py
  52. 1 6
      wbb/utils/json_prettify.py
  53. 1 4
      wbb/utils/misc.py

+ 1 - 3
sample_config.py

@@ -8,9 +8,7 @@ if HEROKU:
     API_HASH = environ.get("API_HASH", "eb06d4abfb49dc3eeb1aeb98ae0f581e")
     API_HASH = environ.get("API_HASH", "eb06d4abfb49dc3eeb1aeb98ae0f581e")
     SESSION_STRING = environ.get("SESSION_STRING", None)
     SESSION_STRING = environ.get("SESSION_STRING", None)
     USERBOT_PREFIX = environ.get("USERBOT_PREFIX", None)
     USERBOT_PREFIX = environ.get("USERBOT_PREFIX", None)
-    SUDO_USERS_ID = list(
-        int(x) for x in environ.get("SUDO_USERS_ID", "").split()
-    )
+    SUDO_USERS_ID = list(int(x) for x in environ.get("SUDO_USERS_ID", "").split())
     LOG_GROUP_ID = int(environ.get("LOG_GROUP_ID", None))
     LOG_GROUP_ID = int(environ.get("LOG_GROUP_ID", None))
     GBAN_LOG_GROUP_ID = int(environ.get("GBAN_LOG_GROUP_ID", None))
     GBAN_LOG_GROUP_ID = int(environ.get("GBAN_LOG_GROUP_ID", None))
     MESSAGE_DUMP_CHAT = int(environ.get("MESSAGE_DUMP_CHAT", None))
     MESSAGE_DUMP_CHAT = int(environ.get("MESSAGE_DUMP_CHAT", None))

+ 2 - 1
wbb/__init__.py

@@ -29,9 +29,10 @@ from os import path
 from motor.motor_asyncio import AsyncIOMotorClient as MongoClient
 from motor.motor_asyncio import AsyncIOMotorClient as MongoClient
 from pyrogram import Client
 from pyrogram import Client
 from pyromod import listen
 from pyromod import listen
-from Python_ARQ import ARQ
 from telegraph import Telegraph
 from telegraph import Telegraph
 
 
+from Python_ARQ import ARQ
+
 print("[INFO]: INITIALIZING")
 print("[INFO]: INITIALIZING")
 is_config = path.exists("config.py")
 is_config = path.exists("config.py")
 if is_config:
 if is_config:

+ 6 - 21
wbb/__main__.py

@@ -28,7 +28,6 @@ import re
 import uvloop
 import uvloop
 from pyrogram import filters, idle
 from pyrogram import filters, idle
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
-
 from wbb import BOT_NAME, BOT_USERNAME, USERBOT_NAME, app
 from wbb import BOT_NAME, BOT_USERNAME, USERBOT_NAME, app
 from wbb.modules import ALL_MODULES
 from wbb.modules import ALL_MODULES
 from wbb.modules.sudoers import bot_sys_stats
 from wbb.modules.sudoers import bot_sys_stats
@@ -43,15 +42,9 @@ async def start_bot():
     global COMMANDS_COUNT
     global COMMANDS_COUNT
     for module in ALL_MODULES:
     for module in ALL_MODULES:
         imported_module = importlib.import_module("wbb.modules." + module)
         imported_module = importlib.import_module("wbb.modules." + module)
-        if (
-            hasattr(imported_module, "__MODULE__")
-            and imported_module.__MODULE__
-        ):
+        if hasattr(imported_module, "__MODULE__") and imported_module.__MODULE__:
             imported_module.__MODULE__ = imported_module.__MODULE__
             imported_module.__MODULE__ = imported_module.__MODULE__
-            if (
-                hasattr(imported_module, "__HELP__")
-                and imported_module.__HELP__
-            ):
+            if hasattr(imported_module, "__HELP__") and imported_module.__HELP__:
                 HELPABLE[imported_module.__MODULE__.lower()] = imported_module
                 HELPABLE[imported_module.__MODULE__.lower()] = imported_module
     bot_modules = ""
     bot_modules = ""
     j = 1
     j = 1
@@ -91,9 +84,7 @@ async def help_command(_, message):
                     InlineKeyboardButton(
                     InlineKeyboardButton(
                         text="System Stats 💻", callback_data="stats_callback"
                         text="System Stats 💻", callback_data="stats_callback"
                     ),
                     ),
-                    InlineKeyboardButton(
-                        text="Support 👨", url="t.me/WBBSupport"
-                    ),
+                    InlineKeyboardButton(text="Support 👨", url="t.me/WBBSupport"),
                 ],
                 ],
             ]
             ]
         )
         )
@@ -102,9 +93,7 @@ async def help_command(_, message):
     keyboard = InlineKeyboardMarkup(
     keyboard = InlineKeyboardMarkup(
         [
         [
             [
             [
-                InlineKeyboardButton(
-                    text="Commands ❓", callback_data="bot_commands"
-                ),
+                InlineKeyboardButton(text="Commands ❓", callback_data="bot_commands"),
                 InlineKeyboardButton(
                 InlineKeyboardButton(
                     text="Repo 🛠",
                     text="Repo 🛠",
                     url="https://github.com/thehamkercat/WilliamButcherBot",
                     url="https://github.com/thehamkercat/WilliamButcherBot",
@@ -185,9 +174,7 @@ General command are:
     if mod_match:
     if mod_match:
         module = mod_match.group(1)
         module = mod_match.group(1)
         text = (
         text = (
-            "{} **{}**:\n".format(
-                "Here is the help for", HELPABLE[module].__MODULE__
-            )
+            "{} **{}**:\n".format("Here is the help for", HELPABLE[module].__MODULE__)
             + HELPABLE[module].__HELP__
             + HELPABLE[module].__HELP__
         )
         )
 
 
@@ -222,9 +209,7 @@ General command are:
     elif back_match:
     elif back_match:
         await query.message.edit(
         await query.message.edit(
             text=top_text,
             text=top_text,
-            reply_markup=InlineKeyboardMarkup(
-                paginate_modules(0, HELPABLE, "help")
-            ),
+            reply_markup=InlineKeyboardMarkup(paginate_modules(0, HELPABLE, "help")),
             disable_web_page_preview=True,
             disable_web_page_preview=True,
         )
         )
 
 

+ 0 - 1
wbb/core/decorators/errors.py

@@ -4,7 +4,6 @@ import traceback
 from functools import wraps
 from functools import wraps
 
 
 from pyrogram.errors.exceptions.forbidden_403 import ChatWriteForbidden
 from pyrogram.errors.exceptions.forbidden_403 import ChatWriteForbidden
-
 from wbb import LOG_GROUP_ID, app
 from wbb import LOG_GROUP_ID, app
 
 
 
 

+ 3 - 9
wbb/core/types/InlineQueryResult.py

@@ -131,9 +131,7 @@ class InlineQueryResultAudio(InlineQueryResult):
             thumb=thumb,
             thumb=thumb,
             content=audio,
             content=audio,
             send_message=(
             send_message=(
-                await self.input_message_content.write(
-                    client, self.reply_markup
-                )
+                await self.input_message_content.write(client, self.reply_markup)
                 if self.input_message_content
                 if self.input_message_content
                 else raw.types.InputBotInlineMessageMediaAuto(
                 else raw.types.InputBotInlineMessageMediaAuto(
                     reply_markup=await self.reply_markup.write(client)
                     reply_markup=await self.reply_markup.write(client)
@@ -233,9 +231,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
             description=self.description,
             description=self.description,
             document=document,
             document=document,
             send_message=(
             send_message=(
-                await self.input_message_content.write(
-                    client, self.reply_markup
-                )
+                await self.input_message_content.write(client, self.reply_markup)
                 if self.input_message_content
                 if self.input_message_content
                 else raw.types.InputBotInlineMessageMediaAuto(
                 else raw.types.InputBotInlineMessageMediaAuto(
                     reply_markup=await self.reply_markup.write(client)
                     reply_markup=await self.reply_markup.write(client)
@@ -267,9 +263,7 @@ def get_input_file_from_file_id(
         )
         )
 
 
     if file_type in (FileType.THUMBNAIL, FileType.CHAT_PHOTO):
     if file_type in (FileType.THUMBNAIL, FileType.CHAT_PHOTO):
-        raise ValueError(
-            f"This file_id can only be used for download: {file_id}"
-        )
+        raise ValueError(f"This file_id can only be used for download: {file_id}")
 
 
     if file_type in PHOTO_TYPES:
     if file_type in PHOTO_TYPES:
         return raw.types.InputPhoto(
         return raw.types.InputPhoto(

+ 24 - 68
wbb/modules/admin.py

@@ -25,7 +25,6 @@ import asyncio
 
 
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import ChatPermissions
 from pyrogram.types import ChatPermissions
-
 from wbb import BOT_ID, SUDOERS, app
 from wbb import BOT_ID, SUDOERS, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.dbfunctions import (add_warn, get_warn, int_to_alpha,
 from wbb.utils.dbfunctions import (add_warn, get_warn, int_to_alpha,
@@ -51,9 +50,7 @@ __HELP__ = """/ban - Ban A User
 
 
 async def list_admins(chat_id: int):
 async def list_admins(chat_id: int):
     list_of_admins = []
     list_of_admins = []
-    async for member in app.iter_chat_members(
-        chat_id, filter="administrators"
-    ):
+    async for member in app.iter_chat_members(chat_id, filter="administrators"):
         list_of_admins.append(member.user.id)
         list_of_admins.append(member.user.id)
     return list_of_admins
     return list_of_admins
 
 
@@ -153,8 +150,7 @@ async def purge(client, message):
                     )
                     )
             else:
             else:
                 await message.reply_text(
                 await message.reply_text(
-                    "Reply To A Message To Delete It,"
-                    " Don't Make Fun Of Yourself!"
+                    "Reply To A Message To Delete It," " Don't Make Fun Of Yourself!"
                 )
                 )
         else:
         else:
             await message.reply_text("Your Don't Have Enough Permissions!")
             await message.reply_text("Your Don't Have Enough Permissions!")
@@ -174,10 +170,7 @@ async def kick(_, message):
         from_user_id = message.from_user.id
         from_user_id = message.from_user.id
         chat_id = message.chat.id
         chat_id = message.chat.id
         permissions = await member_permissions(chat_id, from_user_id)
         permissions = await member_permissions(chat_id, from_user_id)
-        if (
-            "can_restrict_members" not in permissions
-            and from_user_id not in SUDOERS
-        ):
+        if "can_restrict_members" not in permissions and from_user_id not in SUDOERS:
             await message.reply_text("You don't have enough permissions.")
             await message.reply_text("You don't have enough permissions.")
             return
             return
         if len(message.command) == 2:
         if len(message.command) == 2:
@@ -211,10 +204,7 @@ async def ban(_, message):
         from_user_id = message.from_user.id
         from_user_id = message.from_user.id
         chat_id = message.chat.id
         chat_id = message.chat.id
         permissions = await member_permissions(chat_id, from_user_id)
         permissions = await member_permissions(chat_id, from_user_id)
-        if (
-            "can_restrict_members" not in permissions
-            and from_user_id not in SUDOERS
-        ):
+        if "can_restrict_members" not in permissions and from_user_id not in SUDOERS:
             await message.reply_text("You don't have enough permissions.")
             await message.reply_text("You don't have enough permissions.")
             return
             return
         if len(message.command) == 2:
         if len(message.command) == 2:
@@ -245,10 +235,7 @@ async def unban(_, message):
         from_user_id = message.from_user.id
         from_user_id = message.from_user.id
         chat_id = message.chat.id
         chat_id = message.chat.id
         permissions = await member_permissions(chat_id, from_user_id)
         permissions = await member_permissions(chat_id, from_user_id)
-        if (
-            "can_restrict_members" not in permissions
-            and from_user_id not in SUDOERS
-        ):
+        if "can_restrict_members" not in permissions and from_user_id not in SUDOERS:
             await message.reply_text("You don't have enough permissions.")
             await message.reply_text("You don't have enough permissions.")
             return
             return
         if len(message.command) == 2:
         if len(message.command) == 2:
@@ -279,13 +266,9 @@ async def delete(_, message):
         from_user_id = message.from_user.id
         from_user_id = message.from_user.id
         chat_id = message.chat.id
         chat_id = message.chat.id
         permissions = await member_permissions(chat_id, from_user_id)
         permissions = await member_permissions(chat_id, from_user_id)
-        if (
-            "can_delete_messages" not in permissions
-            and from_user_id not in SUDOERS
-        ):
+        if "can_delete_messages" not in permissions and from_user_id not in SUDOERS:
             await message.reply_text(
             await message.reply_text(
-                "You Don't Have Enough Permissions,"
-                + " Consider Deleting Yourself!"
+                "You Don't Have Enough Permissions," + " Consider Deleting Yourself!"
             )
             )
             return
             return
         await message.reply_to_message.delete()
         await message.reply_to_message.delete()
@@ -304,10 +287,7 @@ async def promote(_, message):
         from_user_id = message.from_user.id
         from_user_id = message.from_user.id
         chat_id = message.chat.id
         chat_id = message.chat.id
         permissions = await member_permissions(chat_id, from_user_id)
         permissions = await member_permissions(chat_id, from_user_id)
-        if (
-            "can_promote_members" not in permissions
-            and from_user_id not in SUDOERS
-        ):
+        if "can_promote_members" not in permissions and from_user_id not in SUDOERS:
             await message.reply_text("You don't have enough permissions")
             await message.reply_text("You don't have enough permissions")
             return
             return
         bot = await app.get_chat_member(chat_id, BOT_ID)
         bot = await app.get_chat_member(chat_id, BOT_ID)
@@ -337,8 +317,10 @@ async def promote(_, message):
     except Exception as e:
     except Exception as e:
         await message.reply_text(str(e))
         await message.reply_text(str(e))
 
 
+
 # Demote Member
 # Demote Member
 
 
+
 @app.on_message(filters.command("demote") & ~filters.edited)
 @app.on_message(filters.command("demote") & ~filters.edited)
 @capture_err
 @capture_err
 async def demote(_, message):
 async def demote(_, message):
@@ -375,6 +357,7 @@ async def demote(_, message):
     except Exception as e:
     except Exception as e:
         await message.reply_text(str(e))
         await message.reply_text(str(e))
 
 
+
 # Pin Messages
 # Pin Messages
 
 
 
 
@@ -407,10 +390,7 @@ async def mute(_, message):
         from_user_id = message.from_user.id
         from_user_id = message.from_user.id
         chat_id = message.chat.id
         chat_id = message.chat.id
         permissions = await member_permissions(chat_id, from_user_id)
         permissions = await member_permissions(chat_id, from_user_id)
-        if (
-            "can_restrict_members" not in permissions
-            and from_user_id not in SUDOERS
-        ):
+        if "can_restrict_members" not in permissions and from_user_id not in SUDOERS:
             await message.reply_text("You don't have enough permissions.")
             await message.reply_text("You don't have enough permissions.")
             return
             return
         if len(message.command) == 2:
         if len(message.command) == 2:
@@ -425,9 +405,7 @@ async def mute(_, message):
         if user_id in SUDOERS:
         if user_id in SUDOERS:
             await message.reply_text("You Wanna Mute The Elevated One?")
             await message.reply_text("You Wanna Mute The Elevated One?")
             return
             return
-        await message.chat.restrict_member(
-            user_id, permissions=ChatPermissions()
-        )
+        await message.chat.restrict_member(user_id, permissions=ChatPermissions())
         await message.reply_text("Muted!")
         await message.reply_text("Muted!")
     except Exception as e:
     except Exception as e:
         await message.reply_text(str(e))
         await message.reply_text(str(e))
@@ -443,10 +421,7 @@ async def unmute(_, message):
         from_user_id = message.from_user.id
         from_user_id = message.from_user.id
         chat_id = message.chat.id
         chat_id = message.chat.id
         permissions = await member_permissions(chat_id, from_user_id)
         permissions = await member_permissions(chat_id, from_user_id)
-        if (
-            "can_restrict_members" not in permissions
-            and from_user_id not in SUDOERS
-        ):
+        if "can_restrict_members" not in permissions and from_user_id not in SUDOERS:
             await message.reply_text("You don't have enough permissions.")
             await message.reply_text("You don't have enough permissions.")
             return
             return
         if len(message.command) == 2:
         if len(message.command) == 2:
@@ -487,9 +462,7 @@ async def ban_deleted_accounts(_, message):
                         print(str(e))
                         print(str(e))
                         pass
                         pass
                     banned_users += 1
                     banned_users += 1
-                await message.reply_text(
-                    f"Banned {banned_users} Deleted Accounts"
-                )
+                await message.reply_text(f"Banned {banned_users} Deleted Accounts")
             else:
             else:
                 await message.reply_text("No Deleted Accounts In This Chat")
                 await message.reply_text("No Deleted Accounts In This Chat")
                 return
                 return
@@ -523,16 +496,12 @@ async def warn_user(_, message):
                 await message.reply_text("I wouldn't do that if i were you.")
                 await message.reply_text("I wouldn't do that if i were you.")
             else:
             else:
                 if user_id in await list_members(chat_id):
                 if user_id in await list_members(chat_id):
-                    warns = await get_warn(
-                        chat_id, await int_to_alpha(user_id)
-                    )
+                    warns = await get_warn(chat_id, await int_to_alpha(user_id))
                     if warns:
                     if warns:
                         warns = warns["warns"]
                         warns = warns["warns"]
                     else:
                     else:
                         warn = {"warns": 1}
                         warn = {"warns": 1}
-                        await add_warn(
-                            chat_id, await int_to_alpha(user_id), warn
-                        )
+                        await add_warn(chat_id, await int_to_alpha(user_id), warn)
                         await message.reply_text(
                         await message.reply_text(
                             f"Warned {mention} !, 1/3 warnings now."
                             f"Warned {mention} !, 1/3 warnings now."
                         )
                         )
@@ -542,14 +511,10 @@ async def warn_user(_, message):
                         await message.reply_text(
                         await message.reply_text(
                             f"Number of warns of {mention} exceeded, Banned!"
                             f"Number of warns of {mention} exceeded, Banned!"
                         )
                         )
-                        await remove_warns(
-                            chat_id, await int_to_alpha(user_id)
-                        )
+                        await remove_warns(chat_id, await int_to_alpha(user_id))
                     else:
                     else:
                         warn = {"warns": warns + 1}
                         warn = {"warns": warns + 1}
-                        await add_warn(
-                            chat_id, await int_to_alpha(user_id), warn
-                        )
+                        await add_warn(chat_id, await int_to_alpha(user_id), warn)
                         await message.reply_text(
                         await message.reply_text(
                             f"Warned {mention} !, {warns+1}/3 warnings now."
                             f"Warned {mention} !, {warns+1}/3 warnings now."
                         )
                         )
@@ -568,9 +533,7 @@ async def warn_user(_, message):
 @capture_err
 @capture_err
 async def remove_warnings(_, message):
 async def remove_warnings(_, message):
     if not message.reply_to_message:
     if not message.reply_to_message:
-        await message.reply_text(
-            "Reply to a message to remove a user's warnings."
-        )
+        await message.reply_text("Reply to a message to remove a user's warnings.")
         return
         return
     try:
     try:
         from_user_id = message.from_user.id
         from_user_id = message.from_user.id
@@ -600,9 +563,7 @@ async def remove_warnings(_, message):
 @capture_err
 @capture_err
 async def check_warns(_, message):
 async def check_warns(_, message):
     if not message.reply_to_message:
     if not message.reply_to_message:
-        await message.reply_text(
-            "Reply to a message to check a user's warnings."
-        )
+        await message.reply_text("Reply to a message to check a user's warnings.")
         return
         return
     try:
     try:
         user_id = message.reply_to_message.from_user.id
         user_id = message.reply_to_message.from_user.id
@@ -616,9 +577,7 @@ async def check_warns(_, message):
             else:
             else:
                 await message.reply_text(f"{mention_user} have no warnings.")
                 await message.reply_text(f"{mention_user} have no warnings.")
                 return
                 return
-            await message.reply_text(
-                f"{mention_user} have {warns}/3 warnings."
-            )
+            await message.reply_text(f"{mention_user} have {warns}/3 warnings.")
             return
             return
         warns = await get_warn(chat_id, await int_to_alpha(user_id))
         warns = await get_warn(chat_id, await int_to_alpha(user_id))
         if warns:
         if warns:
@@ -626,9 +585,7 @@ async def check_warns(_, message):
         else:
         else:
             await message.reply_text(f"{mention_user} have no warnings.")
             await message.reply_text(f"{mention_user} have no warnings.")
             return
             return
-        await message.reply_text(
-            f"{mention_from_user} have {warns}/3 warnings."
-        )
+        await message.reply_text(f"{mention_from_user} have {warns}/3 warnings.")
     except Exception as e:
     except Exception as e:
         await message.reply_text(str(e))
         await message.reply_text(str(e))
 
 
@@ -637,8 +594,7 @@ async def check_warns(_, message):
 
 
 
 
 @app.on_message(
 @app.on_message(
-    filters.command(["report", "admins"], prefixes=["@", "/"])
-    & ~filters.edited
+    filters.command(["report", "admins"], prefixes=["@", "/"]) & ~filters.edited
 )
 )
 @capture_err
 @capture_err
 async def report_user(_, message):
 async def report_user(_, message):

+ 3 - 11
wbb/modules/admin_misc.py

@@ -24,7 +24,6 @@ SOFTWARE.
 import os
 import os
 
 
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import SUDOERS, app
 from wbb import SUDOERS, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.modules.admin import member_permissions
 from wbb.modules.admin import member_permissions
@@ -101,17 +100,10 @@ async def set_chat_photo(_, message):
                 await message.reply_text("You Don't Have Enough Permissions.")
                 await message.reply_text("You Don't Have Enough Permissions.")
                 return
                 return
         if not message.reply_to_message:
         if not message.reply_to_message:
-            await message.reply_text(
-                "Reply to a photo to set it as chat_photo"
-            )
+            await message.reply_text("Reply to a photo to set it as chat_photo")
             return
             return
-        if (
-            not message.reply_to_message.photo
-            and not message.reply_to_message.document
-        ):
-            await message.reply_text(
-                "Reply to a photo to set it as chat_photo"
-            )
+        if not message.reply_to_message.photo and not message.reply_to_message.document:
+            await message.reply_text("Reply to a photo to set it as chat_photo")
             return
             return
         photo = await message.reply_to_message.download()
         photo = await message.reply_to_message.download()
         await message.chat.set_photo(photo)
         await message.chat.set_photo(photo)

+ 0 - 1
wbb/modules/alive.py

@@ -23,7 +23,6 @@ SOFTWARE.
 """
 """
 
 
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import BOT_ID, SUDOERS, USERBOT_PREFIX, app2
 from wbb import BOT_ID, SUDOERS, USERBOT_PREFIX, app2
 
 
 
 

+ 10 - 17
wbb/modules/anime.py

@@ -6,7 +6,6 @@ from datetime import timedelta
 import requests
 import requests
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 
 
@@ -186,9 +185,7 @@ def calculate_eta(current, total, start_time):
     end_time = time.time()
     end_time = time.time()
     elapsed_time = end_time - start_time
     elapsed_time = end_time - start_time
     seconds = (elapsed_time * (total / current)) - elapsed_time
     seconds = (elapsed_time * (total / current)) - elapsed_time
-    thing = "".join(str(timedelta(seconds=seconds)).split(".")[:-1]).split(
-        ", "
-    )
+    thing = "".join(str(timedelta(seconds=seconds)).split(".")[:-1]).split(", ")
     thing[-1] = thing[-1].rjust(8, "0")
     thing[-1] = thing[-1].rjust(8, "0")
     return ", ".join(thing)
     return ", ".join(thing)
 
 
@@ -205,9 +202,7 @@ async def anime_search(_, message):
     search = message.text.split(None, 1)[1]
     search = message.text.split(None, 1)[1]
     variables = {"search": search}
     variables = {"search": search}
     json = (
     json = (
-        requests.post(
-            url, json={"query": anime_query, "variables": variables}
-        )
+        requests.post(url, json={"query": anime_query, "variables": variables})
         .json()["data"]
         .json()["data"]
         .get("Media", None)
         .get("Media", None)
     )
     )
@@ -267,17 +262,15 @@ async def manga_search(_, message):
     search = message.text.split(None, 1)[1]
     search = message.text.split(None, 1)[1]
     variables = {"search": search}
     variables = {"search": search}
     json = (
     json = (
-        requests.post(
-            url, json={"query": manga_query, "variables": variables}
-        )
+        requests.post(url, json={"query": manga_query, "variables": variables})
         .json()["data"]
         .json()["data"]
         .get("Media", None)
         .get("Media", None)
     )
     )
     ms_g = ""
     ms_g = ""
     if json:
     if json:
-        title, title_native = json["title"].get("romaji", False), json[
-            "title"
-        ].get("native", False)
+        title, title_native = json["title"].get("romaji", False), json["title"].get(
+            "native", False
+        )
         start_date, status, score = (
         start_date, status, score = (
             json["startDate"].get("year", False),
             json["startDate"].get("year", False),
             json.get("status", False),
             json.get("status", False),
@@ -319,14 +312,14 @@ async def character_search(_, message):
     search = message.text.split(None, 1)[1]
     search = message.text.split(None, 1)[1]
     variables = {"query": search}
     variables = {"query": search}
     json = (
     json = (
-        requests.post(
-            url, json={"query": character_query, "variables": variables}
-        )
+        requests.post(url, json={"query": character_query, "variables": variables})
         .json()["data"]
         .json()["data"]
         .get("Character", None)
         .get("Character", None)
     )
     )
     if json:
     if json:
-        ms_g = f"**{json.get('name').get('full')}**(`{json.get('name').get('native')}`)\n"
+        ms_g = (
+            f"**{json.get('name').get('full')}**(`{json.get('name').get('native')}`)\n"
+        )
         description = f"{json['description']}"
         description = f"{json['description']}"
         site_url = json.get("siteUrl")
         site_url = json.get("siteUrl")
         ms_g += shorten(description, site_url)
         ms_g += shorten(description, site_url)

+ 1 - 4
wbb/modules/antiservice.py

@@ -2,7 +2,6 @@
 # Kang With Proper Credits
 # Kang With Proper Credits
 
 
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.modules.admin import member_permissions
 from wbb.modules.admin import member_permissions
@@ -42,9 +41,7 @@ async def anti_service(_, message):
             "Disabled AntiService System. I won't Be Deleting Service Message from Now on."
             "Disabled AntiService System. I won't Be Deleting Service Message from Now on."
         )
         )
     else:
     else:
-        await message.reply_text(
-            "Unknown Suffix, Use /antiservice [enable|disable]"
-        )
+        await message.reply_text("Unknown Suffix, Use /antiservice [enable|disable]")
 
 
 
 
 @app.on_message(filters.service, group=11)
 @app.on_message(filters.service, group=11)

+ 0 - 1
wbb/modules/arq.py

@@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 SOFTWARE.
 """
 """
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import ARQ_API_URL, app, arq
 from wbb import ARQ_API_URL, app, arq
 
 
 
 

+ 5 - 16
wbb/modules/blacklist.py

@@ -26,7 +26,6 @@ import traceback
 
 
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import ChatPermissions
 from pyrogram.types import ChatPermissions
-
 from wbb import SUDOERS, app
 from wbb import SUDOERS, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.modules.admin import list_admins, member_permissions
 from wbb.modules.admin import list_admins, member_permissions
@@ -43,9 +42,7 @@ __HELP__ = """
 """
 """
 
 
 
 
-@app.on_message(
-    filters.command("blacklist") & ~filters.edited & ~filters.private
-)
+@app.on_message(filters.command("blacklist") & ~filters.edited & ~filters.private)
 @capture_err
 @capture_err
 async def save_filters(_, message):
 async def save_filters(_, message):
     if len(message.command) < 2:
     if len(message.command) < 2:
@@ -65,9 +62,7 @@ async def save_filters(_, message):
     await message.reply_text(f"__**Blacklisted {word}.**__")
     await message.reply_text(f"__**Blacklisted {word}.**__")
 
 
 
 
-@app.on_message(
-    filters.command("blacklisted") & ~filters.edited & ~filters.private
-)
+@app.on_message(filters.command("blacklisted") & ~filters.edited & ~filters.private)
 @capture_err
 @capture_err
 async def get_filterss(_, message):
 async def get_filterss(_, message):
     data = await get_blacklisted_words(message.chat.id)
     data = await get_blacklisted_words(message.chat.id)
@@ -80,9 +75,7 @@ async def get_filterss(_, message):
         await message.reply_text(msg)
         await message.reply_text(msg)
 
 
 
 
-@app.on_message(
-    filters.command("whitelist") & ~filters.edited & ~filters.private
-)
+@app.on_message(filters.command("whitelist") & ~filters.edited & ~filters.private)
 @capture_err
 @capture_err
 async def del_filter(_, message):
 async def del_filter(_, message):
     if len(message.command) < 2:
     if len(message.command) < 2:
@@ -105,9 +98,7 @@ async def del_filter(_, message):
         await message.reply_text("**No such blacklist filter.**")
         await message.reply_text("**No such blacklist filter.**")
 
 
 
 
-@app.on_message(
-    filters.text & ~filters.private, group=blacklist_filters_group
-)
+@app.on_message(filters.text & ~filters.private, group=blacklist_filters_group)
 async def blacklist_filters_re(_, message):
 async def blacklist_filters_re(_, message):
     text = message.text.lower().strip()
     text = message.text.lower().strip()
     if not text:
     if not text:
@@ -126,9 +117,7 @@ async def blacklist_filters_re(_, message):
                 if user.id in await list_admins(chat_id):
                 if user.id in await list_admins(chat_id):
                     return
                     return
                 try:
                 try:
-                    await message.chat.restrict_member(
-                        user.id, ChatPermissions()
-                    )
+                    await message.chat.restrict_member(user.id, ChatPermissions())
                 except Exception:
                 except Exception:
                     return
                     return
                 await app.send_message(
                 await app.send_message(

+ 0 - 1
wbb/modules/blacklist_chat.py

@@ -1,6 +1,5 @@
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import Message
 from pyrogram.types import Message
-
 from wbb import SUDOERS, app
 from wbb import SUDOERS, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.dbfunctions import (blacklist_chat, blacklisted_chats,
 from wbb.utils.dbfunctions import (blacklist_chat, blacklisted_chats,

+ 0 - 1
wbb/modules/carbon.py

@@ -1,7 +1,6 @@
 import os
 import os
 
 
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.functions import make_carbon
 from wbb.utils.functions import make_carbon

+ 6 - 23
wbb/modules/chatbot.py

@@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 SOFTWARE.
 """
 """
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import (BOT_ID, SUDOERS, USERBOT_ID, USERBOT_PREFIX, USERBOT_USERNAME,
 from wbb import (BOT_ID, SUDOERS, USERBOT_ID, USERBOT_PREFIX, USERBOT_USERNAME,
                  app, app2, arq)
                  app, app2, arq)
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
@@ -54,10 +53,7 @@ async def chatbot_status(_, message):
     if status == "ON" or status == "on" or status == "On":
     if status == "ON" or status == "on" or status == "On":
         if chat_id not in active_chats_bot:
         if chat_id not in active_chats_bot:
             active_chats_bot.append(chat_id)
             active_chats_bot.append(chat_id)
-            text = (
-                "Chatbot Enabled Reply To Any Message "
-                + "Of Mine To Get A Reply"
-            )
+            text = "Chatbot Enabled Reply To Any Message " + "Of Mine To Get A Reply"
             await message.reply_text(text)
             await message.reply_text(text)
             return
             return
         await message.reply_text("ChatBot Is Already Enabled.")
         await message.reply_text("ChatBot Is Already Enabled.")
@@ -81,11 +77,7 @@ async def lunaQuery(query: str, user_id: int):
 
 
 
 
 @app.on_message(
 @app.on_message(
-    filters.text
-    & filters.reply
-    & ~filters.bot
-    & ~filters.via_bot
-    & ~filters.forwarded,
+    filters.text & filters.reply & ~filters.bot & ~filters.via_bot & ~filters.forwarded,
     group=chatbot_group,
     group=chatbot_group,
 )
 )
 @capture_err
 @capture_err
@@ -98,9 +90,7 @@ async def chatbot_talk(_, message):
         return
         return
     query = message.text
     query = message.text
     await app2.send_chat_action(message.chat.id, "typing")
     await app2.send_chat_action(message.chat.id, "typing")
-    response = await lunaQuery(
-        query, message.from_user.id if message.from_user else 0
-    )
+    response = await lunaQuery(query, message.from_user.id if message.from_user else 0)
     await app2.send_chat_action(message.chat.id, "cancel")
     await app2.send_chat_action(message.chat.id, "cancel")
     await message.reply_text(response)
     await message.reply_text(response)
 
 
@@ -124,10 +114,7 @@ async def chatbot_status_ubot(_, message):
     if status == "ON" or status == "on" or status == "On":
     if status == "ON" or status == "on" or status == "On":
         if chat_id not in active_chats_ubot:
         if chat_id not in active_chats_ubot:
             active_chats_ubot.append(chat_id)
             active_chats_ubot.append(chat_id)
-            text = (
-                "Chatbot Enabled Reply To Any Message "
-                + "Of Mine To Get A Reply"
-            )
+            text = "Chatbot Enabled Reply To Any Message " + "Of Mine To Get A Reply"
             await edit_or_reply(message, text=text)
             await edit_or_reply(message, text=text)
             return
             return
         await edit_or_reply(message, text="ChatBot Is Already Enabled.")
         await edit_or_reply(message, text="ChatBot Is Already Enabled.")
@@ -165,9 +152,7 @@ async def chatbot_talk_ubot(_, message):
         if username not in query:
         if username not in query:
             return
             return
     await app2.send_chat_action(message.chat.id, "typing")
     await app2.send_chat_action(message.chat.id, "typing")
-    response = await lunaQuery(
-        query, message.from_user.id if message.from_user else 0
-    )
+    response = await lunaQuery(query, message.from_user.id if message.from_user else 0)
     await app2.send_chat_action(message.chat.id, "cancel")
     await app2.send_chat_action(message.chat.id, "cancel")
     await message.reply_text(response)
     await message.reply_text(response)
 
 
@@ -182,8 +167,6 @@ async def chatbot_talk_ubot_pm(_, message):
         return
         return
     query = message.text
     query = message.text
     await app2.send_chat_action(message.chat.id, "typing")
     await app2.send_chat_action(message.chat.id, "typing")
-    response = await lunaQuery(
-        query, message.from_user.id if message.from_user else 0
-    )
+    response = await lunaQuery(query, message.from_user.id if message.from_user else 0)
     await message.reply_text(response)
     await message.reply_text(response)
     await app2.send_chat_action(message.chat.id, "cancel")
     await app2.send_chat_action(message.chat.id, "cancel")

+ 2 - 7
wbb/modules/couple.py

@@ -25,7 +25,6 @@ import random
 from datetime import datetime
 from datetime import datetime
 
 
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.dbfunctions import get_couple, save_couple
 from wbb.utils.dbfunctions import get_couple, save_couple
@@ -85,9 +84,7 @@ async def couple(_, message):
 {c1_mention} + {c2_mention} = ❤️
 {c1_mention} + {c2_mention} = ❤️
 
 
 __New couple of the day may be chosen at 12AM {tomorrow}__"""
 __New couple of the day may be chosen at 12AM {tomorrow}__"""
-            await app.send_message(
-                message.chat.id, text=couple_selection_message
-            )
+            await app.send_message(message.chat.id, text=couple_selection_message)
             couple = {"c1_id": c1_id, "c2_id": c2_id}
             couple = {"c1_id": c1_id, "c2_id": c2_id}
             await save_couple(chat_id, today, couple)
             await save_couple(chat_id, today, couple)
 
 
@@ -100,9 +97,7 @@ __New couple of the day may be chosen at 12AM {tomorrow}__"""
 [{c1_name}](tg://openmessage?user_id={c1_id}) + [{c2_name}](tg://openmessage?user_id={c2_id}) = ❤️
 [{c1_name}](tg://openmessage?user_id={c1_id}) + [{c2_name}](tg://openmessage?user_id={c2_id}) = ❤️
 
 
 __New couple of the day may be chosen at 12AM {tomorrow}__"""
 __New couple of the day may be chosen at 12AM {tomorrow}__"""
-            await app.send_message(
-                message.chat.id, text=couple_selection_message
-            )
+            await app.send_message(message.chat.id, text=couple_selection_message)
     except Exception as e:
     except Exception as e:
         print(e)
         print(e)
         await message.reply_text(e)
         await message.reply_text(e)

+ 1 - 4
wbb/modules/covid.py

@@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 SOFTWARE.
 """
 """
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.fetch import fetch
 from wbb.utils.fetch import fetch
@@ -44,9 +43,7 @@ async def covid(_, message):
     if len(message.command) != 1:
     if len(message.command) != 1:
         country = message.text.split(None, 1)[1].strip()
         country = message.text.split(None, 1)[1].strip()
         country = country.replace(" ", "")
         country = country.replace(" ", "")
-        data = await fetch(
-            f"https://corona.lmao.ninja/v2/countries/{country}"
-        )
+        data = await fetch(f"https://corona.lmao.ninja/v2/countries/{country}")
         data = await json_prettify(data)
         data = await json_prettify(data)
         await app.send_message(message.chat.id, text=data)
         await app.send_message(message.chat.id, text=data)
         return
         return

+ 2 - 11
wbb/modules/devs.py

@@ -16,7 +16,6 @@ from time import time
 
 
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
-
 from wbb import SUDOERS, app
 from wbb import SUDOERS, app
 
 
 __MODULE__ = "Devs"
 __MODULE__ = "Devs"
@@ -79,13 +78,7 @@ async def executor(client, message):
             out_file.write(str(evaluation.strip()))
             out_file.write(str(evaluation.strip()))
         t2 = time()
         t2 = time()
         keyboard = InlineKeyboardMarkup(
         keyboard = InlineKeyboardMarkup(
-            [
-                [
-                    InlineKeyboardButton(
-                        text="⏳", callback_data=f"runtime {t2-t1} Seconds"
-                    )
-                ]
-            ]
+            [[InlineKeyboardButton(text="⏳", callback_data=f"runtime {t2-t1} Seconds")]]
         )
         )
         await message.reply_document(
         await message.reply_document(
             document=filename,
             document=filename,
@@ -162,9 +155,7 @@ async def shellrunner(client, message):
                 value=exc_obj,
                 value=exc_obj,
                 tb=exc_tb,
                 tb=exc_tb,
             )
             )
-            await edit_or_reply(
-                message, text=f"**ERROR:**\n```{''.join(errors)}```"
-            )
+            await edit_or_reply(message, text=f"**ERROR:**\n```{''.join(errors)}```")
             return
             return
         output = process.stdout.read()[:-1].decode("utf-8")
         output = process.stdout.read()[:-1].decode("utf-8")
     if str(output) == "\n":
     if str(output) == "\n":

+ 4 - 14
wbb/modules/filters.py

@@ -25,7 +25,6 @@ import re
 import traceback
 import traceback
 
 
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import SUDOERS, app
 from wbb import SUDOERS, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.modules.admin import member_permissions
 from wbb.modules.admin import member_permissions
@@ -44,9 +43,7 @@ __HELP__ = """/filters To Get All The Filters In The Chat.
 You can use markdown or html to save text too."""
 You can use markdown or html to save text too."""
 
 
 
 
-@app.on_message(
-    filters.command("filter") & ~filters.edited & ~filters.private
-)
+@app.on_message(filters.command("filter") & ~filters.edited & ~filters.private)
 @capture_err
 @capture_err
 async def save_filters(_, message):
 async def save_filters(_, message):
     chat_id = message.chat.id
     chat_id = message.chat.id
@@ -56,10 +53,7 @@ async def save_filters(_, message):
             "**Usage:**\nReply to a text or sticker with /filter [FILTER_NAME] to save it."
             "**Usage:**\nReply to a text or sticker with /filter [FILTER_NAME] to save it."
         )
         )
         return
         return
-    if (
-        not message.reply_to_message.text
-        and not message.reply_to_message.sticker
-    ):
+    if not message.reply_to_message.text and not message.reply_to_message.sticker:
         await message.reply_text(
         await message.reply_text(
             "__**You can only save text or stickers in filters.**__"
             "__**You can only save text or stickers in filters.**__"
         )
         )
@@ -83,9 +77,7 @@ async def save_filters(_, message):
     await message.reply_text(f"__**Saved filter {name}.**__")
     await message.reply_text(f"__**Saved filter {name}.**__")
 
 
 
 
-@app.on_message(
-    filters.command("filters") & ~filters.edited & ~filters.private
-)
+@app.on_message(filters.command("filters") & ~filters.edited & ~filters.private)
 @capture_err
 @capture_err
 async def get_filterss(_, message):
 async def get_filterss(_, message):
     _filters = await get_filters_names(message.chat.id)
     _filters = await get_filters_names(message.chat.id)
@@ -147,9 +139,7 @@ async def filters_re(_, message):
                         await message.reply_to_message.reply_text(
                         await message.reply_to_message.reply_text(
                             data, disable_web_page_preview=True
                             data, disable_web_page_preview=True
                         )
                         )
-                    await message.reply_text(
-                        data, disable_web_page_preview=True
-                    )
+                    await message.reply_text(data, disable_web_page_preview=True)
                 else:
                 else:
                     if message.reply_to_message:
                     if message.reply_to_message:
                         await message.reply_to_message.reply_sticker(data)
                         await message.reply_to_message.reply_sticker(data)

+ 1 - 4
wbb/modules/genstr.py

@@ -4,7 +4,6 @@ from asyncio.exceptions import TimeoutError
 from pyrogram import Client, filters
 from pyrogram import Client, filters
 from pyrogram.errors import (PhoneCodeExpired, PhoneCodeInvalid,
 from pyrogram.errors import (PhoneCodeExpired, PhoneCodeInvalid,
                              PhoneNumberInvalid, SessionPasswordNeeded)
                              PhoneNumberInvalid, SessionPasswordNeeded)
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 
 
@@ -69,9 +68,7 @@ async def genstr(_, message):
         )
         )
 
 
     except TimeoutError:
     except TimeoutError:
-        await message.reply_text(
-            "Time limit reached of 5 min. Process Cancelled."
-        )
+        await message.reply_text("Time limit reached of 5 min. Process Cancelled.")
         return
         return
     otp_code = otp.text
     otp_code = otp.text
     try:
     try:

+ 1 - 4
wbb/modules/global_stats.py

@@ -24,7 +24,6 @@ SOFTWARE.
 import asyncio
 import asyncio
 
 
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import BOT_ID, BOT_NAME, SUDOERS, app
 from wbb import BOT_ID, BOT_NAME, SUDOERS, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.modules import ALL_MODULES
 from wbb.modules import ALL_MODULES
@@ -39,9 +38,7 @@ from wbb.utils.inlinefuncs import keywords_list
 """ CHAT WATCHER IS IN filters.py"""
 """ CHAT WATCHER IS IN filters.py"""
 
 
 
 
-@app.on_message(
-    filters.command("gstats") & filters.user(SUDOERS) & ~filters.edited
-)
+@app.on_message(filters.command("gstats") & filters.user(SUDOERS) & ~filters.edited)
 @capture_err
 @capture_err
 async def global_stats(_, message):
 async def global_stats(_, message):
     m = await app.send_message(
     m = await app.send_message(

+ 6 - 19
wbb/modules/greetings.py

@@ -33,7 +33,6 @@ from pyrogram.errors.exceptions.bad_request_400 import (ChatAdminRequired,
                                                         UserNotParticipant)
                                                         UserNotParticipant)
 from pyrogram.types import (ChatPermissions, InlineKeyboardButton,
 from pyrogram.types import (ChatPermissions, InlineKeyboardButton,
                             InlineKeyboardMarkup, Message, User)
                             InlineKeyboardMarkup, Message, User)
-
 from wbb import SUDOERS, WELCOME_DELAY_KICK_SEC, app
 from wbb import SUDOERS, WELCOME_DELAY_KICK_SEC, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.modules.admin import member_permissions
 from wbb.modules.admin import member_permissions
@@ -176,9 +175,7 @@ async def welcome(_, message: Message):
         """ Save captcha answers etc in mongodb in case bot gets crashed or restarted. """
         """ Save captcha answers etc in mongodb in case bot gets crashed or restarted. """
         await update_captcha_cache(answers_dicc)
         await update_captcha_cache(answers_dicc)
         asyncio.create_task(
         asyncio.create_task(
-            kick_restricted_after_delay(
-                WELCOME_DELAY_KICK_SEC, button_message, member
-            )
+            kick_restricted_after_delay(WELCOME_DELAY_KICK_SEC, button_message, member)
         )
         )
         await asyncio.sleep(0.5)
         await asyncio.sleep(0.5)
 
 
@@ -196,9 +193,7 @@ async def send_welcome_message(callback_query, pending_user_id):
     if "{chat}" in text:
     if "{chat}" in text:
         text = text.replace("{chat}", callback_query.message.chat.title)
         text = text.replace("{chat}", callback_query.message.chat.title)
     if "{name}" in text:
     if "{name}" in text:
-        text = text.replace(
-            "{name}", (await app.get_users(pending_user_id)).mention
-        )
+        text = text.replace("{name}", (await app.get_users(pending_user_id)).mention)
     buttons = InlineKeyboard(row_width=2)
     buttons = InlineKeyboard(row_width=2)
     list_of_buttons = []
     list_of_buttons = []
     for button_string in buttons_text_list:
     for button_string in buttons_text_list:
@@ -208,9 +203,7 @@ async def send_welcome_message(callback_query, pending_user_id):
         button_string = button_string.split(",")
         button_string = button_string.split(",")
         button_text = button_string[0].strip()
         button_text = button_string[0].strip()
         button_url = button_string[1].strip()
         button_url = button_string[1].strip()
-        list_of_buttons.append(
-            InlineKeyboardButton(text=button_text, url=button_url)
-        )
+        list_of_buttons.append(InlineKeyboardButton(text=button_text, url=button_url))
     buttons.add(*list_of_buttons)
     buttons.add(*list_of_buttons)
     await app.send_message(
     await app.send_message(
         callback_query.message.chat.id,
         callback_query.message.chat.id,
@@ -253,9 +246,7 @@ async def callback_query_welcome_button(_, callback_query):
                         answers_dicc.remove(iii)
                         answers_dicc.remove(iii)
                         await button_message.chat.kick_member(pending_user_id)
                         await button_message.chat.kick_member(pending_user_id)
                         await asyncio.sleep(1)
                         await asyncio.sleep(1)
-                        await button_message.chat.unban_member(
-                            pending_user_id
-                        )
+                        await button_message.chat.unban_member(pending_user_id)
                         await button_message.delete()
                         await button_message.delete()
                         await update_captcha_cache(answers_dicc)
                         await update_captcha_cache(answers_dicc)
                         return
                         return
@@ -290,9 +281,7 @@ async def callback_query_welcome_button(_, callback_query):
         return
         return
 
 
 
 
-async def kick_restricted_after_delay(
-    delay, button_message: Message, user: User
-):
+async def kick_restricted_after_delay(delay, button_message: Message, user: User):
     """If the new member is still restricted after the delay, delete
     """If the new member is still restricted after the delay, delete
     button message and join message and then kick him
     button message and join message and then kick him
     """
     """
@@ -311,9 +300,7 @@ async def kick_restricted_after_delay(
     await _ban_restricted_user_until_date(group_chat, user_id, duration=delay)
     await _ban_restricted_user_until_date(group_chat, user_id, duration=delay)
 
 
 
 
-async def _ban_restricted_user_until_date(
-    group_chat, user_id: int, duration: int
-):
+async def _ban_restricted_user_until_date(group_chat, user_id: int, duration: int):
     try:
     try:
         member = await group_chat.get_member(user_id)
         member = await group_chat.get_member(user_id)
         if member.status == "restricted":
         if member.status == "restricted":

+ 1 - 4
wbb/modules/images.py

@@ -26,7 +26,6 @@ import json
 import urllib.request
 import urllib.request
 
 
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 
 
@@ -44,9 +43,7 @@ async def delete_message_with_delay(delay, message):
 @app.on_message(filters.command("cat") & ~filters.edited)
 @app.on_message(filters.command("cat") & ~filters.edited)
 @capture_err
 @capture_err
 async def cat(_, message):
 async def cat(_, message):
-    with urllib.request.urlopen(
-        "https://api.thecatapi.com/v1/images/search"
-    ) as url:
+    with urllib.request.urlopen("https://api.thecatapi.com/v1/images/search") as url:
         data = json.loads(url.read().decode())
         data = json.loads(url.read().decode())
     cat_url = data[0]["url"]
     cat_url = data[0]["url"]
     await message.reply_photo(cat_url)
     await message.reply_photo(cat_url)

+ 2 - 1
wbb/modules/info.py

@@ -2,7 +2,6 @@ import os
 
 
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import Message
 from pyrogram.types import Message
-
 from wbb import SUDOERS, app
 from wbb import SUDOERS, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.dbfunctions import is_gbanned_user, user_global_karma
 from wbb.utils.dbfunctions import is_gbanned_user, user_global_karma
@@ -16,6 +15,8 @@ __HELP__ = """
 
 
 async def get_user_info(user):
 async def get_user_info(user):
     user = await app.get_users(user)
     user = await app.get_users(user)
+    if not user.first_name:
+        return ["Deleted account", None]
     user_id = user.id
     user_id = user.id
     username = user.username
     username = user.username
     first_name = user.first_name
     first_name = user.first_name

+ 18 - 54
wbb/modules/inline.py

@@ -39,15 +39,11 @@ async def inline_query_handler(client, query):
         answers = []
         answers = []
         if text.strip() == "":
         if text.strip() == "":
             answerss = await inline_help_func(__HELP__)
             answerss = await inline_help_func(__HELP__)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=10
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=10)
             return
             return
         elif text.split()[0] == "alive":
         elif text.split()[0] == "alive":
             answerss = await alive_function(answers)
             answerss = await alive_function(answers)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=10
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=10)
         elif text.split()[0] == "tr":
         elif text.split()[0] == "tr":
             if len(text.split()) < 3:
             if len(text.split()) < 3:
                 await client.answer_inline_query(
                 await client.answer_inline_query(
@@ -105,9 +101,7 @@ async def inline_query_handler(client, query):
                 return
                 return
             tex = text.split(None, 1)[1].strip()
             tex = text.split(None, 1)[1].strip()
             answerss = await shortify(tex)
             answerss = await shortify(tex)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
 
 
         elif text.split()[0] == "wall":
         elif text.split()[0] == "wall":
             if len(text.split()) < 2:
             if len(text.split()) < 2:
@@ -202,9 +196,7 @@ async def inline_query_handler(client, query):
                 return
                 return
             tex = text.split(None, 1)[1].strip()
             tex = text.split(None, 1)[1].strip()
             answerss = await github_user_func(answers, tex)
             answerss = await github_user_func(answers, tex)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
 
 
         elif text.split()[0] == "gh_repo":
         elif text.split()[0] == "gh_repo":
             if len(text.split()) < 2:
             if len(text.split()) < 2:
@@ -217,9 +209,7 @@ async def inline_query_handler(client, query):
                 return
                 return
             tex = text.split(None, 1)[1].strip()
             tex = text.split(None, 1)[1].strip()
             answerss = await github_repo_func(answers, tex)
             answerss = await github_repo_func(answers, tex)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
 
 
         elif text.split()[0] == "search":
         elif text.split()[0] == "search":
             if len(text.split()) < 2:
             if len(text.split()) < 2:
@@ -233,9 +223,7 @@ async def inline_query_handler(client, query):
             user_id = query.from_user.id
             user_id = query.from_user.id
             tex = text.split(None, 1)[1].strip()
             tex = text.split(None, 1)[1].strip()
             answerss = await tg_search_func(answers, tex, user_id)
             answerss = await tg_search_func(answers, tex, user_id)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
 
 
         elif text.split()[0] == "music":
         elif text.split()[0] == "music":
             if len(text.split()) < 2:
             if len(text.split()) < 2:
@@ -248,9 +236,7 @@ async def inline_query_handler(client, query):
                 return
                 return
             tex = text.split(None, 1)[1].strip()
             tex = text.split(None, 1)[1].strip()
             answerss = await music_inline_func(answers, tex)
             answerss = await music_inline_func(answers, tex)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
 
 
         elif text.split()[0] == "wiki":
         elif text.split()[0] == "wiki":
             if len(text.split()) < 2:
             if len(text.split()) < 2:
@@ -263,15 +249,11 @@ async def inline_query_handler(client, query):
                 return
                 return
             tex = text.split(None, 1)[1].strip()
             tex = text.split(None, 1)[1].strip()
             answerss = await wiki_func(answers, tex)
             answerss = await wiki_func(answers, tex)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
 
 
         elif text.split()[0] == "speedtest":
         elif text.split()[0] == "speedtest":
             answerss = await speedtest_init(query)
             answerss = await speedtest_init(query)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
             return
             return
 
 
         elif text.split()[0] == "paste":
         elif text.split()[0] == "paste":
@@ -285,9 +267,7 @@ async def inline_query_handler(client, query):
                 return
                 return
             link = text.strip().split()[1]
             link = text.strip().split()[1]
             answerss = await pastebin_func(answers, link)
             answerss = await pastebin_func(answers, link)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
             return
             return
 
 
         elif text.split()[0] == "carbon":
         elif text.split()[0] == "carbon":
@@ -301,25 +281,19 @@ async def inline_query_handler(client, query):
                 return
                 return
             link = text.split()[1]
             link = text.split()[1]
             answerss = await carbon_inline_func(answers, link)
             answerss = await carbon_inline_func(answers, link)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
             return
             return
 
 
         elif text.split()[0] == "pmpermit":
         elif text.split()[0] == "pmpermit":
             user_id = query.from_user.id
             user_id = query.from_user.id
             victim = text.split()[1]
             victim = text.split()[1]
             answerss = await pmpermit_func(answers, user_id, victim)
             answerss = await pmpermit_func(answers, user_id, victim)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
             return
             return
 
 
         elif text.split()[0] == "ping":
         elif text.split()[0] == "ping":
             answerss = await ping_func(answers)
             answerss = await ping_func(answers)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
             return
             return
 
 
         elif text.split()[0] == "nsfw_scan":
         elif text.split()[0] == "nsfw_scan":
@@ -333,9 +307,7 @@ async def inline_query_handler(client, query):
                 return
                 return
             tex = text.split(None, 1)[1].strip()
             tex = text.split(None, 1)[1].strip()
             answerss = await nsfw_scan_func(answers, tex)
             answerss = await nsfw_scan_func(answers, tex)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
 
 
         elif text.split()[0] == "ytmusic":
         elif text.split()[0] == "ytmusic":
             if len(text.split()) < 2:
             if len(text.split()) < 2:
@@ -349,9 +321,7 @@ async def inline_query_handler(client, query):
             tex = query.query.split(None, 1)[1].strip()
             tex = query.query.split(None, 1)[1].strip()
             user_id = query.from_user.id
             user_id = query.from_user.id
             answerss = await yt_music_func(answers, tex, user_id)
             answerss = await yt_music_func(answers, tex, user_id)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
 
 
         elif text.split()[0] == "info":
         elif text.split()[0] == "info":
             if len(text.split()) < 2:
             if len(text.split()) < 2:
@@ -364,9 +334,7 @@ async def inline_query_handler(client, query):
                 return
                 return
             tex = text.split()[1].strip()
             tex = text.split()[1].strip()
             answerss = await user_info_inline_func(answers, tex)
             answerss = await user_info_inline_func(answers, tex)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
 
 
         elif text.split()[0] == "chat_info":
         elif text.split()[0] == "chat_info":
             if len(text.split()) < 2:
             if len(text.split()) < 2:
@@ -379,9 +347,7 @@ async def inline_query_handler(client, query):
                 return
                 return
             tex = text.split()[1].strip()
             tex = text.split()[1].strip()
             answerss = await chat_info_inline_func(answers, tex)
             answerss = await chat_info_inline_func(answers, tex)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
 
 
         elif text.split()[0] == "tmdb":
         elif text.split()[0] == "tmdb":
             if len(text.split()) < 2:
             if len(text.split()) < 2:
@@ -395,9 +361,7 @@ async def inline_query_handler(client, query):
                 return
                 return
             tex = text.split()[1].strip()
             tex = text.split()[1].strip()
             answerss = await tmdb_func(answers, tex)
             answerss = await tmdb_func(answers, tex)
-            await client.answer_inline_query(
-                query.id, results=answerss, cache_time=2
-            )
+            await client.answer_inline_query(query.id, results=answerss, cache_time=2)
     except Exception as e:
     except Exception as e:
         e = traceback.format_exc()
         e = traceback.format_exc()
         print(e, " InLine")
         print(e, " InLine")

+ 13 - 11
wbb/modules/karma.py

@@ -21,8 +21,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 SOFTWARE.
 """
 """
-from pyrogram import filters
+import asyncio
 
 
+from pyrogram import filters
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.modules.admin import member_permissions
 from wbb.modules.admin import member_permissions
@@ -39,9 +40,7 @@ Reply to a message with /karma to check a user's karma
 Send /karma without replying to any message to chek karma list of top 10 users"""
 Send /karma without replying to any message to chek karma list of top 10 users"""
 
 
 
 
-regex_upvote = (
-    r"^((?i)\+|\+\+|\+1|thx|tnx|ty|thank you|thanx|thanks|pro|cool|good|👍)$"
-)
+regex_upvote = r"^((?i)\+|\+\+|\+1|thx|tnx|ty|thank you|thanx|thanks|pro|cool|good|👍)$"
 regex_downvote = r"^(\-|\-\-|\-1|👎)$"
 regex_downvote = r"^(\-|\-\-|\-1|👎)$"
 
 
 
 
@@ -128,8 +127,8 @@ async def downvote(_, message):
 @capture_err
 @capture_err
 async def karma(_, message):
 async def karma(_, message):
     chat_id = message.chat.id
     chat_id = message.chat.id
-
     if not message.reply_to_message:
     if not message.reply_to_message:
+        m = await message.reply_text("Analyzing Karma...Will Take 20 Seconds")
         karma = await get_karmas(chat_id)
         karma = await get_karmas(chat_id)
         msg = f"**Karma list of {message.chat.title}:- **\n"
         msg = f"**Karma list of {message.chat.title}:- **\n"
         limit = 0
         limit = 0
@@ -139,25 +138,28 @@ async def karma(_, message):
             user_karma = karma[i]["karma"]
             user_karma = karma[i]["karma"]
             karma_dicc[str(user_id)] = user_karma
             karma_dicc[str(user_id)] = user_karma
             karma_arranged = dict(
             karma_arranged = dict(
-                sorted(
-                    karma_dicc.items(), key=lambda item: item[1], reverse=True
-                )
+                sorted(karma_dicc.items(), key=lambda item: item[1], reverse=True)
             )
             )
         if not karma_arranged:
         if not karma_arranged:
-            await message.reply_text("No karma in DB for this chat.")
+            await m.edit("No karma in DB for this chat.")
             return
             return
         for user_idd, karma_count in karma_arranged.items():
         for user_idd, karma_count in karma_arranged.items():
             if limit > 9:
             if limit > 9:
                 break
                 break
             try:
             try:
                 user = await app.get_users(int(user_idd))
                 user = await app.get_users(int(user_idd))
+                await asyncio.sleep(2)
             except Exception:
             except Exception:
                 continue
                 continue
             first_name = user.first_name
             first_name = user.first_name
+            if not first_name:
+                continue
             username = user.username
             username = user.username
-            msg += f"{first_name} [{username if username else ''} `{user_idd}`]: `{karma_count}`\n"
+            msg += (
+                f"**{karma_count}**  {(first_name[0:12] + '...') if len(first_name) > 12 else first_name}  `{('@' + username) if username else user_idd}`\n"
+            )
             limit += 1
             limit += 1
-        await message.reply_text(msg)
+        await m.edit(msg)
     else:
     else:
         user_id = message.reply_to_message.from_user.id
         user_id = message.reply_to_message.from_user.id
         karma = await get_karma(chat_id, await int_to_alpha(user_id))
         karma = await get_karma(chat_id, await int_to_alpha(user_id))

+ 3 - 11
wbb/modules/locks.py

@@ -24,7 +24,6 @@ SOFTWARE.
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.errors.exceptions.bad_request_400 import ChatNotModified
 from pyrogram.errors.exceptions.bad_request_400 import ChatNotModified
 from pyrogram.types import ChatPermissions
 from pyrogram.types import ChatPermissions
-
 from wbb import SUDOERS, app
 from wbb import SUDOERS, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.modules.admin import current_chat_permissions, member_permissions
 from wbb.modules.admin import current_chat_permissions, member_permissions
@@ -72,13 +71,9 @@ async def tg_lock(message, permissions: list, perm: str, lock: bool):
     (permissions.remove(perm) if lock else permissions.append(perm))
     (permissions.remove(perm) if lock else permissions.append(perm))
     permissions = {perm: True for perm in list(set(permissions))}
     permissions = {perm: True for perm in list(set(permissions))}
     try:
     try:
-        await app.set_chat_permissions(
-            message.chat.id, ChatPermissions(**permissions)
-        )
+        await app.set_chat_permissions(message.chat.id, ChatPermissions(**permissions))
     except ChatNotModified:
     except ChatNotModified:
-        await message.reply_text(
-            "To unlock this, you have to unlock 'messages' first."
-        )
+        await message.reply_text("To unlock this, you have to unlock 'messages' first.")
         return
         return
     await message.reply_text(("Locked." if lock else "Unlocked."))
     await message.reply_text(("Locked." if lock else "Unlocked."))
 
 
@@ -100,10 +95,7 @@ async def locks_func(_, message):
             return
             return
 
 
         permissions = await member_permissions(chat_id, user_id)
         permissions = await member_permissions(chat_id, user_id)
-        if (
-            "can_restrict_members" not in permissions
-            and user_id not in SUDOERS
-        ):
+        if "can_restrict_members" not in permissions and user_id not in SUDOERS:
             await message.reply_text("You Don't Have Enough Permissions.")
             await message.reply_text("You Don't Have Enough Permissions.")
             return
             return
 
 

+ 10 - 15
wbb/modules/misc.py

@@ -28,7 +28,6 @@ import aiohttp
 from cryptography.fernet import Fernet
 from cryptography.fernet import Fernet
 from googletrans import Translator
 from googletrans import Translator
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import FERNET_ENCRYPTION_KEY, app
 from wbb import FERNET_ENCRYPTION_KEY, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils import random_line
 from wbb.utils import random_line
@@ -64,9 +63,7 @@ async def rtfm(_, message):
     if not message.reply_to_message:
     if not message.reply_to_message:
         await message.reply_text("Reply To A Message lol")
         await message.reply_text("Reply To A Message lol")
         return
         return
-    await message.reply_to_message.reply_text(
-        "Are You Lost? READ THE FUCKING DOCS!"
-    )
+    await message.reply_to_message.reply_text("Are You Lost? READ THE FUCKING DOCS!")
 
 
 
 
 @app.on_message(filters.command("runs") & ~filters.edited)
 @app.on_message(filters.command("runs") & ~filters.edited)
@@ -83,7 +80,9 @@ async def getid(_, message):
         return
         return
     text_unping = "<b>Chat ID:</b>"
     text_unping = "<b>Chat ID:</b>"
     if message.chat.username:
     if message.chat.username:
-        text_unping = f'<a href="https://t.me/{message.chat.username}">{text_unping}</a>'
+        text_unping = (
+            f'<a href="https://t.me/{message.chat.username}">{text_unping}</a>'
+        )
     text_unping += f" <code>{message.chat.id}</code>\n"
     text_unping += f" <code>{message.chat.id}</code>\n"
     text = "<b>Message ID:</b>"
     text = "<b>Message ID:</b>"
     if message.link:
     if message.link:
@@ -113,7 +112,9 @@ async def getid(_, message):
             text_unping += "\n"
             text_unping += "\n"
             text = "<b>Forwarded User ID:</b>"
             text = "<b>Forwarded User ID:</b>"
             if reply.forward_from.username:
             if reply.forward_from.username:
-                text = f'<a href="https://t.me/{reply.forward_from.username}">{text}</a>'
+                text = (
+                    f'<a href="https://t.me/{reply.forward_from.username}">{text}</a>'
+                )
             text += f" <code>{reply.forward_from.id}</code>\n"
             text += f" <code>{reply.forward_from.id}</code>\n"
             text_unping += text
             text_unping += text
             text_ping += f'\n<b><a href="tg://user?id={reply.forward_from.id}">Forwarded User ID:</a></b> <code>{reply.forward_from.id}</code>\n'
             text_ping += f'\n<b><a href="tg://user?id={reply.forward_from.id}">Forwarded User ID:</a></b> <code>{reply.forward_from.id}</code>\n'
@@ -133,18 +134,14 @@ async def getid(_, message):
 @capture_err
 @capture_err
 async def random(_, message):
 async def random(_, message):
     if len(message.command) != 2:
     if len(message.command) != 2:
-        await message.reply_text(
-            '"/random" Needs An Argurment.' " Ex: `/random 5`"
-        )
+        await message.reply_text('"/random" Needs An Argurment.' " Ex: `/random 5`")
         return
         return
     length = message.text.split(None, 1)[1]
     length = message.text.split(None, 1)[1]
 
 
     try:
     try:
         if 1 < int(length) < 1000:
         if 1 < int(length) < 1000:
             alphabet = string.ascii_letters + string.digits
             alphabet = string.ascii_letters + string.digits
-            password = "".join(
-                secrets.choice(alphabet) for i in range(int(length))
-            )
+            password = "".join(secrets.choice(alphabet) for i in range(int(length)))
             await message.reply_text(f"`{password}`")
             await message.reply_text(f"`{password}`")
         else:
         else:
             await message.reply_text("Specify A Length Between 1-1000")
             await message.reply_text("Specify A Length Between 1-1000")
@@ -189,9 +186,7 @@ async def decrypt(_, message):
 
 
 
 
 async def fetch_text(url):
 async def fetch_text(url):
-    async with aiohttp.ClientSession(
-        headers={"user-agent": "curl"}
-    ) as session:
+    async with aiohttp.ClientSession(headers={"user-agent": "curl"}) as session:
         async with session.get(url) as resp:
         async with session.get(url) as resp:
             data = await resp.text()
             data = await resp.text()
     return data
     return data

+ 4 - 13
wbb/modules/music.py

@@ -32,7 +32,6 @@ import aiohttp
 import ffmpeg
 import ffmpeg
 import youtube_dl
 import youtube_dl
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import SUDOERS, app, arq
 from wbb import SUDOERS, app, arq
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.pastebin import paste
 from wbb.utils.pastebin import paste
@@ -63,9 +62,7 @@ async def download_youtube_audio(url: str, m=0):
         info_dict = ydl.extract_info(url, download=False)
         info_dict = ydl.extract_info(url, download=False)
         if int(float(info_dict["duration"])) > 600:
         if int(float(info_dict["duration"])) > 600:
             if m != 0:
             if m != 0:
-                await m.edit(
-                    "This music cannot be downloaded as it's too long."
-                )
+                await m.edit("This music cannot be downloaded as it's too long.")
             is_downloading = False
             is_downloading = False
             return
             return
         ydl.process_info(info_dict)
         ydl.process_info(info_dict)
@@ -79,18 +76,14 @@ async def download_youtube_audio(url: str, m=0):
             os.remove(audio_file)
             os.remove(audio_file)
             audio_file = audio_file_opus
             audio_file = audio_file_opus
         thumbnail_url = info_dict["thumbnail"]
         thumbnail_url = info_dict["thumbnail"]
-        thumbnail_file = (
-            basename + "." + get_file_extension_from_url(thumbnail_url)
-        )
+        thumbnail_file = basename + "." + get_file_extension_from_url(thumbnail_url)
         title = info_dict["title"]
         title = info_dict["title"]
         performer = info_dict["uploader"]
         performer = info_dict["uploader"]
         duration = int(float(info_dict["duration"]))
         duration = int(float(info_dict["duration"]))
     return [title, performer, duration, audio_file, thumbnail_file]
     return [title, performer, duration, audio_file, thumbnail_file]
 
 
 
 
-@app.on_message(
-    filters.command("ytmusic") & ~filters.edited & filters.user(SUDOERS)
-)
+@app.on_message(filters.command("ytmusic") & ~filters.edited & filters.user(SUDOERS))
 @capture_err
 @capture_err
 async def music(_, message):
 async def music(_, message):
     global is_downloading
     global is_downloading
@@ -104,9 +97,7 @@ async def music(_, message):
         )
         )
         return
         return
     is_downloading = True
     is_downloading = True
-    m = await message.reply_text(
-        f"Downloading {url}", disable_web_page_preview=True
-    )
+    m = await message.reply_text(f"Downloading {url}", disable_web_page_preview=True)
     try:
     try:
         (
         (
             title,
             title,

+ 6 - 22
wbb/modules/notes.py

@@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 SOFTWARE.
 """
 """
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.modules.admin import member_permissions
 from wbb.modules.admin import member_permissions
@@ -44,18 +43,10 @@ async def save_notee(_, message):
             "**Usage:**\nReply to a text or sticker with /save [NOTE_NAME] to save it."
             "**Usage:**\nReply to a text or sticker with /save [NOTE_NAME] to save it."
         )
         )
 
 
-    elif (
-        not message.reply_to_message.text
-        and not message.reply_to_message.sticker
-    ):
-        await message.reply_text(
-            "__**You can only save text or stickers in notes.**__"
-        )
+    elif not message.reply_to_message.text and not message.reply_to_message.sticker:
+        await message.reply_text("__**You can only save text or stickers in notes.**__")
 
 
-    elif (
-        len(await member_permissions(message.chat.id, message.from_user.id))
-        < 1
-    ):
+    elif len(await member_permissions(message.chat.id, message.from_user.id)) < 1:
         await message.reply_text("**You don't have enough permissions**")
         await message.reply_text("**You don't have enough permissions**")
     else:
     else:
         name = message.text.split(None, 1)[1].strip()
         name = message.text.split(None, 1)[1].strip()
@@ -103,25 +94,18 @@ async def get_one_note(_, message):
             await message.reply_text("**No such note.**")
             await message.reply_text("**No such note.**")
         else:
         else:
             if _note["type"] == "text":
             if _note["type"] == "text":
-                await message.reply_text(
-                    _note["data"], disable_web_page_preview=True
-                )
+                await message.reply_text(_note["data"], disable_web_page_preview=True)
             else:
             else:
                 await message.reply_sticker(_note["data"])
                 await message.reply_sticker(_note["data"])
 
 
 
 
-@app.on_message(
-    filters.command("delete") & ~filters.edited & ~filters.private
-)
+@app.on_message(filters.command("delete") & ~filters.edited & ~filters.private)
 @capture_err
 @capture_err
 async def del_note(_, message):
 async def del_note(_, message):
     if len(message.command) < 2:
     if len(message.command) < 2:
         await message.reply_text("**Usage**\n__/delete [NOTE_NAME]__")
         await message.reply_text("**Usage**\n__/delete [NOTE_NAME]__")
 
 
-    elif (
-        len(await member_permissions(message.chat.id, message.from_user.id))
-        < 1
-    ):
+    elif len(await member_permissions(message.chat.id, message.from_user.id)) < 1:
         await message.reply_text("**You don't have enough permissions**")
         await message.reply_text("**You don't have enough permissions**")
 
 
     else:
     else:

+ 2 - 7
wbb/modules/paste.py

@@ -25,7 +25,6 @@ import asyncio
 import os
 import os
 
 
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.functions import get_http_status_code
 from wbb.utils.functions import get_http_status_code
@@ -58,14 +57,10 @@ async def paste_func(_, message):
 
 
         elif message.reply_to_message.document:
         elif message.reply_to_message.document:
             if message.reply_to_message.document.file_size > 1048576:
             if message.reply_to_message.document.file_size > 1048576:
-                await message.reply_text(
-                    "You can only paste files smaller than 1MB."
-                )
+                await message.reply_text("You can only paste files smaller than 1MB.")
                 return
                 return
             m = await message.reply_text("Pasting...")
             m = await message.reply_text("Pasting...")
-            doc_file = await message.reply_to_message.download(
-                file_name="paste.txt"
-            )
+            doc_file = await message.reply_to_message.download(file_name="paste.txt")
             i = open(doc_file, "r")
             i = open(doc_file, "r")
             link = await paste(i.read())
             link = await paste(i.read())
             preview = link + "/preview.png"
             preview = link + "/preview.png"

+ 1 - 6
wbb/modules/pipes.py

@@ -25,7 +25,6 @@ import asyncio
 
 
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import Message
 from pyrogram.types import Message
-
 from wbb import BOT_ID, SUDOERS, USERBOT_ID, app, app2
 from wbb import BOT_ID, SUDOERS, USERBOT_ID, app, app2
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.dbfunctions import (activate_pipe, deactivate_pipe,
 from wbb.utils.dbfunctions import (activate_pipe, deactivate_pipe,
@@ -95,11 +94,7 @@ async def pipes_worker_userbot(_, message: Message):
                     app.listen(USERBOT_ID), message.copy(BOT_ID)
                     app.listen(USERBOT_ID), message.copy(BOT_ID)
                 )
                 )
                 caption = f"Forwarded from `{pipe['from_chat_id']}`"
                 caption = f"Forwarded from `{pipe['from_chat_id']}`"
-                caption = (
-                    f"{temp.caption}\n\n{caption}"
-                    if temp.caption
-                    else caption
-                )
+                caption = f"{temp.caption}\n\n{caption}" if temp.caption else caption
                 await app.copy_message(
                 await app.copy_message(
                     pipe["to_chat_id"],
                     pipe["to_chat_id"],
                     USERBOT_ID,
                     USERBOT_ID,

+ 4 - 13
wbb/modules/pmpermit.py

@@ -23,7 +23,6 @@ SOFTWARE.
 """
 """
 
 
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import BOT_ID, SUDOERS, USERBOT_ID, USERBOT_PREFIX, app, app2
 from wbb import BOT_ID, SUDOERS, USERBOT_ID, USERBOT_PREFIX, app, app2
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.modules.userbot import edit_or_reply
 from wbb.modules.userbot import edit_or_reply
@@ -70,9 +69,7 @@ async def pmpermit_func(_, message):
 @capture_err
 @capture_err
 async def pm_approve(_, message):
 async def pm_approve(_, message):
     if not message.reply_to_message:
     if not message.reply_to_message:
-        await edit_or_reply(
-            message, text="Reply to a user's message to approve."
-        )
+        await edit_or_reply(message, text="Reply to a user's message to approve.")
         return
         return
     user_id = message.reply_to_message.from_user.id
     user_id = message.reply_to_message.from_user.id
     if await is_pmpermit_approved(user_id):
     if await is_pmpermit_approved(user_id):
@@ -89,9 +86,7 @@ async def pm_approve(_, message):
 )
 )
 async def pm_disapprove(_, message):
 async def pm_disapprove(_, message):
     if not message.reply_to_message:
     if not message.reply_to_message:
-        await edit_or_reply(
-            message, text="Reply to a user's message to approve."
-        )
+        await edit_or_reply(message, text="Reply to a user's message to approve.")
         return
         return
     user_id = message.reply_to_message.from_user.id
     user_id = message.reply_to_message.from_user.id
     if not await is_pmpermit_approved(user_id):
     if not await is_pmpermit_approved(user_id):
@@ -115,9 +110,7 @@ async def pm_disapprove(_, message):
 @capture_err
 @capture_err
 async def block_user_func(_, message):
 async def block_user_func(_, message):
     if not message.reply_to_message:
     if not message.reply_to_message:
-        await edit_or_reply(
-            message, text="Reply to a user's message to block."
-        )
+        await edit_or_reply(message, text="Reply to a user's message to block.")
         return
         return
     user_id = message.reply_to_message.from_user.id
     user_id = message.reply_to_message.from_user.id
     await app2.block_user(user_id)
     await app2.block_user(user_id)
@@ -131,9 +124,7 @@ async def block_user_func(_, message):
 )
 )
 async def unblock_user_func(_, message):
 async def unblock_user_func(_, message):
     if not message.reply_to_message:
     if not message.reply_to_message:
-        await edit_or_reply(
-            message, text="Reply to a user's message to unblock."
-        )
+        await edit_or_reply(message, text="Reply to a user's message to unblock.")
         return
         return
     user_id = message.reply_to_message.from_user.id
     user_id = message.reply_to_message.from_user.id
     await app2.unblock_user(user_id)
     await app2.unblock_user(user_id)

+ 2 - 7
wbb/modules/quotly.py

@@ -2,7 +2,6 @@ from io import BytesIO
 
 
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import Message
 from pyrogram.types import Message
-
 from wbb import app, arq
 from wbb import app, arq
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 
 
@@ -44,9 +43,7 @@ async def quotly_func(_, message: Message):
         await message.reply_text("Reply to a message to quote it.")
         await message.reply_text("Reply to a message to quote it.")
         return
         return
     if not message.reply_to_message.text:
     if not message.reply_to_message.text:
-        await message.reply_text(
-            "Replied message has no text, can't quote it."
-        )
+        await message.reply_text("Replied message has no text, can't quote it.")
         return
         return
     m = await message.reply_text("Quoting Messages")
     m = await message.reply_text("Quoting Messages")
     if len(message.command) < 2:
     if len(message.command) < 2:
@@ -83,9 +80,7 @@ async def quotly_func(_, message: Message):
             )
             )
             messages = [reply_message]
             messages = [reply_message]
     else:
     else:
-        await m.edit(
-            "Incorrect argument, check quotly module in help section."
-        )
+        await m.edit("Incorrect argument, check quotly module in help section.")
         return
         return
     try:
     try:
         sticker = await quotify(messages)
         sticker = await quotify(messages)

+ 0 - 1
wbb/modules/reddit.py

@@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 SOFTWARE.
 """
 """
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import app, arq
 from wbb import app, arq
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 
 

+ 1 - 4
wbb/modules/regex.py

@@ -25,7 +25,6 @@ import re
 import sre_constants
 import sre_constants
 
 
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import app
 from wbb import app
 from wbb.utils.filter_groups import regex_group
 from wbb.utils.filter_groups import regex_group
 
 
@@ -71,9 +70,7 @@ async def sed(_, message):
             if "i" in flags and "g" in flags:
             if "i" in flags and "g" in flags:
                 text = re.sub(repl, repl_with, to_fix, flags=re.I).strip()
                 text = re.sub(repl, repl_with, to_fix, flags=re.I).strip()
             elif "i" in flags:
             elif "i" in flags:
-                text = re.sub(
-                    repl, repl_with, to_fix, count=1, flags=re.I
-                ).strip()
+                text = re.sub(repl, repl_with, to_fix, count=1, flags=re.I).strip()
             elif "g" in flags:
             elif "g" in flags:
                 text = re.sub(repl, repl_with, to_fix).strip()
                 text = re.sub(repl, repl_with, to_fix).strip()
             else:
             else:

+ 3 - 10
wbb/modules/repo.py

@@ -22,15 +22,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 SOFTWARE.
 """
 """
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.fetch import fetch
 from wbb.utils.fetch import fetch
 
 
 __MODULE__ = "Repo"
 __MODULE__ = "Repo"
-__HELP__ = (
-    "/repo - To Get My Github Repository Link " "And Support Group Link"
-)
+__HELP__ = "/repo - To Get My Github Repository Link " "And Support Group Link"
 
 
 
 
 @app.on_message(filters.command("repo") & ~filters.edited)
 @app.on_message(filters.command("repo") & ~filters.edited)
@@ -42,9 +39,7 @@ async def repo(_, message):
     list_of_users = ""
     list_of_users = ""
     count = 1
     count = 1
     for user in users:
     for user in users:
-        list_of_users += (
-            f"**{count}.** [{user['login']}]({user['html_url']})\n"
-        )
+        list_of_users += f"**{count}.** [{user['login']}]({user['html_url']})\n"
         count += 1
         count += 1
 
 
     text = f"""[Github](https://github.com/thehamkercat/WilliamButcherBot) | [Group](t.me/PatheticProgrammers)
     text = f"""[Github](https://github.com/thehamkercat/WilliamButcherBot) | [Group](t.me/PatheticProgrammers)
@@ -52,6 +47,4 @@ async def repo(_, message):
 | Contributors |
 | Contributors |
 ----------------```
 ----------------```
 {list_of_users}"""
 {list_of_users}"""
-    await app.send_message(
-        message.chat.id, text=text, disable_web_page_preview=True
-    )
+    await app.send_message(message.chat.id, text=text, disable_web_page_preview=True)

+ 2 - 7
wbb/modules/reverse.py

@@ -6,7 +6,6 @@ import aiohttp
 import requests
 import requests
 from bs4 import BeautifulSoup
 from bs4 import BeautifulSoup
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import SUDOERS, app
 from wbb import SUDOERS, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 
 
@@ -59,9 +58,7 @@ async def reverse_image_search(_, message):
 
 
     if reply.animation:
     if reply.animation:
         if not reply.animation.thumbs:
         if not reply.animation.thumbs:
-            await m.edit(
-                "Gif Has No Thumbnail, so it cannot be reverse searched"
-            )
+            await m.edit("Gif Has No Thumbnail, so it cannot be reverse searched")
             return
             return
         file_id = reply.animation.thumbs[0].file_id
         file_id = reply.animation.thumbs[0].file_id
 
 
@@ -77,9 +74,7 @@ async def reverse_image_search(_, message):
                 "encoded_image": (image, await f.read()),
                 "encoded_image": (image, await f.read()),
                 "image_content": "",
                 "image_content": "",
             }
             }
-            response = requests.post(
-                search_url, files=multipart, allow_redirects=False
-            )
+            response = requests.post(search_url, files=multipart, allow_redirects=False)
             location = response.headers.get("Location")
             location = response.headers.get("Location")
             os.remove(image)
             os.remove(image)
         else:
         else:

+ 3 - 10
wbb/modules/rice.py

@@ -24,7 +24,6 @@ SOFTWARE.
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup,
 from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup,
                             InputMediaPhoto, InputMediaVideo, Message)
                             InputMediaPhoto, InputMediaVideo, Message)
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 
 
@@ -50,9 +49,7 @@ async def rice(_, message: Message):
         reply_markup=InlineKeyboardMarkup(
         reply_markup=InlineKeyboardMarkup(
             [
             [
                 [
                 [
-                    InlineKeyboardButton(
-                        "Approve (Forward)", callback_data="forward"
-                    ),
+                    InlineKeyboardButton("Approve (Forward)", callback_data="forward"),
                     InlineKeyboardButton("Ignore", callback_data="ignore"),
                     InlineKeyboardButton("Ignore", callback_data="ignore"),
                 ]
                 ]
             ]
             ]
@@ -81,15 +78,11 @@ async def callback_query_forward_rice(_, callback_query):
         arg_media = []
         arg_media = []
         for m in media_group:
         for m in media_group:
             if m.photo and m.caption:
             if m.photo and m.caption:
-                arg_media.append(
-                    InputMediaPhoto(m.photo.file_id, caption=arg_caption)
-                )
+                arg_media.append(InputMediaPhoto(m.photo.file_id, caption=arg_caption))
             elif m.photo:
             elif m.photo:
                 arg_media.append(InputMediaPhoto(m.photo.file_id))
                 arg_media.append(InputMediaPhoto(m.photo.file_id))
             elif m.video and m.caption:
             elif m.video and m.caption:
-                arg_media.append(
-                    InputMediaVideo(m.video.file_id, caption=arg_caption)
-                )
+                arg_media.append(InputMediaVideo(m.video.file_id, caption=arg_caption))
             elif m.video:
             elif m.video:
                 arg_media.append(InputMediaVideo(m.video.file_id))
                 arg_media.append(InputMediaVideo(m.video.file_id))
         m_cp = await app.send_media_group(RICE_CHANNEL, arg_media)
         m_cp = await app.send_media_group(RICE_CHANNEL, arg_media)

+ 2 - 8
wbb/modules/stickers.py

@@ -30,7 +30,6 @@ from pyrogram.errors.exceptions.bad_request_400 import (PeerIdInvalid,
                                                         StickerPngNopng,
                                                         StickerPngNopng,
                                                         UserIsBlocked)
                                                         UserIsBlocked)
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
 from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
-
 from wbb import BOT_USERNAME, app
 from wbb import BOT_USERNAME, app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.files import (get_document_from_file_id,
 from wbb.utils.files import (get_document_from_file_id,
@@ -73,10 +72,7 @@ async def kang(client, message):
     args = message.text.split()
     args = message.text.split()
     if len(args) > 1:
     if len(args) > 1:
         sticker_emoji = str(args[1])
         sticker_emoji = str(args[1])
-    elif (
-        message.reply_to_message.sticker
-        and message.reply_to_message.sticker.emoji
-    ):
+    elif message.reply_to_message.sticker and message.reply_to_message.sticker.emoji:
         sticker_emoji = message.reply_to_message.sticker.emoji
         sticker_emoji = message.reply_to_message.sticker.emoji
     else:
     else:
         sticker_emoji = "🤔"
         sticker_emoji = "🤔"
@@ -85,9 +81,7 @@ async def kang(client, message):
     doc = message.reply_to_message.photo or message.reply_to_message.document
     doc = message.reply_to_message.photo or message.reply_to_message.document
     if message.reply_to_message.sticker:
     if message.reply_to_message.sticker:
         sticker = await create_sticker(
         sticker = await create_sticker(
-            await get_document_from_file_id(
-                message.reply_to_message.sticker.file_id
-            ),
+            await get_document_from_file_id(message.reply_to_message.sticker.file_id),
             sticker_emoji,
             sticker_emoji,
         )
         )
     elif doc:
     elif doc:

+ 4 - 10
wbb/modules/sudo.py

@@ -25,7 +25,6 @@ import os
 
 
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import Message
 from pyrogram.types import Message
-
 from wbb import BOT_ID, SUDOERS, USERBOT_PREFIX, app2
 from wbb import BOT_ID, SUDOERS, USERBOT_PREFIX, app2
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 from wbb.modules.userbot import edit_or_reply
 from wbb.modules.userbot import edit_or_reply
@@ -48,8 +47,7 @@ can even delete your account.
 
 
 
 
 @app2.on_message(
 @app2.on_message(
-    filters.command("useradd", prefixes=USERBOT_PREFIX)
-    & filters.user(SUDOERS)
+    filters.command("useradd", prefixes=USERBOT_PREFIX) & filters.user(SUDOERS)
 )
 )
 @capture_err
 @capture_err
 async def useradd(_, message: Message):
 async def useradd(_, message: Message):
@@ -64,9 +62,7 @@ async def useradd(_, message: Message):
         await edit_or_reply(message, text="User is already in sudoers.")
         await edit_or_reply(message, text="User is already in sudoers.")
         return
         return
     if user_id == BOT_ID:
     if user_id == BOT_ID:
-        await edit_or_reply(
-            message, text="You can't add assistant bot in sudoers."
-        )
+        await edit_or_reply(message, text="You can't add assistant bot in sudoers.")
         return
         return
     added = await add_sudo(user_id)
     added = await add_sudo(user_id)
     if added:
     if added:
@@ -80,8 +76,7 @@ async def useradd(_, message: Message):
 
 
 
 
 @app2.on_message(
 @app2.on_message(
-    filters.command("userdel", prefixes=USERBOT_PREFIX)
-    & filters.user(SUDOERS)
+    filters.command("userdel", prefixes=USERBOT_PREFIX) & filters.user(SUDOERS)
 )
 )
 @capture_err
 @capture_err
 async def userdel(_, message: Message):
 async def userdel(_, message: Message):
@@ -107,8 +102,7 @@ async def userdel(_, message: Message):
 
 
 
 
 @app2.on_message(
 @app2.on_message(
-    filters.command("sudoers", prefixes=USERBOT_PREFIX)
-    & filters.user(SUDOERS)
+    filters.command("sudoers", prefixes=USERBOT_PREFIX) & filters.user(SUDOERS)
 )
 )
 @capture_err
 @capture_err
 async def sudoers_list(_, message: Message):
 async def sudoers_list(_, message: Message):

+ 8 - 25
wbb/modules/sudoers.py

@@ -28,7 +28,6 @@ import time
 
 
 import psutil
 import psutil
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import (BOT_ID, GBAN_LOG_GROUP_ID, SUDOERS, USERBOT_USERNAME, app,
 from wbb import (BOT_ID, GBAN_LOG_GROUP_ID, SUDOERS, USERBOT_USERNAME, app,
                  bot_start_time)
                  bot_start_time)
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
@@ -81,9 +80,7 @@ async def get_stats(_, message):
 async def ban_globally(_, message):
 async def ban_globally(_, message):
     if not message.reply_to_message:
     if not message.reply_to_message:
         if len(message.command) < 3:
         if len(message.command) < 3:
-            await message.reply_text(
-                "**Usage:**\n/gban [USERNAME | USER_ID] [REASON]"
-            )
+            await message.reply_text("**Usage:**\n/gban [USERNAME | USER_ID] [REASON]")
             return
             return
         user = message.text.split(None, 2)[1]
         user = message.text.split(None, 2)[1]
         reason = message.text.split(None, 2)[2]
         reason = message.text.split(None, 2)[2]
@@ -98,9 +95,7 @@ async def ban_globally(_, message):
                 "Should i gban myself? I'm not fool like you, HUMAN!"
                 "Should i gban myself? I'm not fool like you, HUMAN!"
             )
             )
         elif user.id in SUDOERS:
         elif user.id in SUDOERS:
-            await message.reply_text(
-                "You want to ban a sudo user? GET REKT!!"
-            )
+            await message.reply_text("You want to ban a sudo user? GET REKT!!")
         else:
         else:
             served_chats = await get_served_chats()
             served_chats = await get_served_chats()
             m = await message.reply_text(
             m = await message.reply_text(
@@ -111,9 +106,7 @@ async def ban_globally(_, message):
             number_of_chats = 0
             number_of_chats = 0
             for served_chat in served_chats:
             for served_chat in served_chats:
                 try:
                 try:
-                    await app.kick_chat_member(
-                        served_chat["chat_id"], user.id
-                    )
+                    await app.kick_chat_member(served_chat["chat_id"], user.id)
                     number_of_chats += 1
                     number_of_chats += 1
                     await asyncio.sleep(1)
                     await asyncio.sleep(1)
                 except Exception:
                 except Exception:
@@ -162,9 +155,7 @@ __**New Global Ban**__
     if user_id == from_user_id:
     if user_id == from_user_id:
         await message.reply_text("You want to gban yourself? FOOL!")
         await message.reply_text("You want to gban yourself? FOOL!")
     elif user_id == BOT_ID:
     elif user_id == BOT_ID:
-        await message.reply_text(
-            "Should i gban myself? I'm not fool like you, HUMAN!"
-        )
+        await message.reply_text("Should i gban myself? I'm not fool like you, HUMAN!")
     elif user_id in SUDOERS:
     elif user_id in SUDOERS:
         await message.reply_text("You want to ban a sudo user? GET REKT!!")
         await message.reply_text("You want to ban a sudo user? GET REKT!!")
     else:
     else:
@@ -180,9 +171,7 @@ __**New Global Ban**__
             number_of_chats = 0
             number_of_chats = 0
             for served_chat in served_chats:
             for served_chat in served_chats:
                 try:
                 try:
-                    await app.kick_chat_member(
-                        served_chat["chat_id"], user_id
-                    )
+                    await app.kick_chat_member(served_chat["chat_id"], user_id)
                     number_of_chats += 1
                     number_of_chats += 1
                     await asyncio.sleep(1)
                     await asyncio.sleep(1)
                 except Exception:
                 except Exception:
@@ -243,9 +232,7 @@ async def unban_globally(_, message):
         if user.id == from_user.id:
         if user.id == from_user.id:
             await message.reply_text("You want to ungban yourself? FOOL!")
             await message.reply_text("You want to ungban yourself? FOOL!")
         elif user.id == BOT_ID:
         elif user.id == BOT_ID:
-            await message.reply_text(
-                "Should i ungban myself? But i'm not gbanned."
-            )
+            await message.reply_text("Should i ungban myself? But i'm not gbanned.")
         elif user.id in SUDOERS:
         elif user.id in SUDOERS:
             await message.reply_text("Sudo users can't be gbanned/ungbanned.")
             await message.reply_text("Sudo users can't be gbanned/ungbanned.")
         else:
         else:
@@ -263,9 +250,7 @@ async def unban_globally(_, message):
     if user_id == from_user_id:
     if user_id == from_user_id:
         await message.reply_text("You want to ungban yourself? FOOL!")
         await message.reply_text("You want to ungban yourself? FOOL!")
     elif user_id == BOT_ID:
     elif user_id == BOT_ID:
-        await message.reply_text(
-            "Should i ungban myself? But i'm not gbanned."
-        )
+        await message.reply_text("Should i ungban myself? But i'm not gbanned.")
     elif user_id in SUDOERS:
     elif user_id in SUDOERS:
         await message.reply_text("Sudo users can't be gbanned/ungbanned.")
         await message.reply_text("Sudo users can't be gbanned/ungbanned.")
     else:
     else:
@@ -280,9 +265,7 @@ async def unban_globally(_, message):
 # Broadcast
 # Broadcast
 
 
 
 
-@app.on_message(
-    filters.command("broadcast") & filters.user(SUDOERS) & ~filters.edited
-)
+@app.on_message(filters.command("broadcast") & filters.user(SUDOERS) & ~filters.edited)
 @capture_err
 @capture_err
 async def broadcast_message(_, message):
 async def broadcast_message(_, message):
     if len(message.command) < 2:
     if len(message.command) < 2:

+ 1 - 4
wbb/modules/telegraph.py

@@ -6,7 +6,6 @@ import os
 
 
 from pyrogram import filters
 from pyrogram import filters
 from telegraph import upload_file
 from telegraph import upload_file
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 
 
@@ -31,9 +30,7 @@ async def tgphoto(client, message):
     msg = await message.reply_text("`Uploading to Telegraph...`")
     msg = await message.reply_text("`Uploading to Telegraph...`")
     userid = str(message.chat.id)
     userid = str(message.chat.id)
     path = f"./DOWNLOADS/{userid}.jpg"
     path = f"./DOWNLOADS/{userid}.jpg"
-    path = await client.download_media(
-        message=message.reply_to_message, file_name=path
-    )
+    path = await client.download_media(message=message.reply_to_message, file_name=path)
     try:
     try:
         tlink = upload_file(path)
         tlink = upload_file(path)
     except Exception:
     except Exception:

+ 0 - 1
wbb/modules/tts.py

@@ -27,7 +27,6 @@ from googletrans import Translator
 from gtts import gTTS
 from gtts import gTTS
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import Message
 from pyrogram.types import Message
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 
 

+ 1 - 4
wbb/modules/userbot.py

@@ -15,7 +15,6 @@ from io import StringIO
 
 
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import Message
 from pyrogram.types import Message
-
 from wbb import SUDOERS, USERBOT_PREFIX, app, app2
 from wbb import SUDOERS, USERBOT_PREFIX, app, app2
 
 
 __MODULE__ = "Userbot"
 __MODULE__ = "Userbot"
@@ -79,9 +78,7 @@ async def executor(client, message):
         evaluation = stdout
         evaluation = stdout
     else:
     else:
         evaluation = "Success"
         evaluation = "Success"
-    final_output = (
-        f"**INPUT:**\n```{cmd}```\n\n**OUTPUT**:\n```{evaluation.strip()}```"
-    )
+    final_output = f"**INPUT:**\n```{cmd}```\n\n**OUTPUT**:\n```{evaluation.strip()}```"
     if len(final_output) > 4096:
     if len(final_output) > 4096:
         filename = "output.txt"
         filename = "output.txt"
         with open(filename, "w+", encoding="utf8") as out_file:
         with open(filename, "w+", encoding="utf8") as out_file:

+ 0 - 1
wbb/modules/webss.py

@@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 SOFTWARE.
 """
 """
 from pyrogram import filters
 from pyrogram import filters
-
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 
 

+ 4 - 12
wbb/utils/aiodownloader/downloader.py

@@ -30,9 +30,7 @@ class DownloadJob:
 
 
         self.file_name = file_url.split("/")[~0]
         self.file_name = file_url.split("/")[~0]
         self.file_path = (
         self.file_path = (
-            os.path.join(save_path, self.file_name)
-            if save_path
-            else self.file_name
+            os.path.join(save_path, self.file_name) if save_path else self.file_name
         )
         )
 
 
         self.completed = False
         self.completed = False
@@ -77,9 +75,7 @@ class DownloadJob:
                 async with aiofiles.open(self.file_path, "wb") as file:
                 async with aiofiles.open(self.file_path, "wb") as file:
 
 
                     # Downloading the file using the aiohttp.StreamReader
                     # Downloading the file using the aiohttp.StreamReader
-                    async for data in resp.content.iter_chunked(
-                        self._chunk_size
-                    ):
+                    async for data in resp.content.iter_chunked(self._chunk_size):
                         await file.write(data)
                         await file.write(data)
                         self._downloaded(self._chunk_size)
                         self._downloaded(self._chunk_size)
 
 
@@ -123,13 +119,9 @@ class Handler:
         :param save_path: save path for the download
         :param save_path: save path for the download
         :return:
         :return:
         """
         """
-        return DownloadJob(
-            self._session, file_url, save_path, self._chunk_size
-        )
+        return DownloadJob(self._session, file_url, save_path, self._chunk_size)
 
 
-    async def download(
-        self, url: str, save_path: Optional[str] = None
-    ) -> DownloadJob:
+    async def download(self, url: str, save_path: Optional[str] = None) -> DownloadJob:
         """
         """
         Downloads a bulk of files from the given list of urls to the given path.
         Downloads a bulk of files from the given list of urls to the given path.
 
 

+ 3 - 11
wbb/utils/dbfunctions.py

@@ -598,10 +598,7 @@ async def deactivate_pipe(from_chat_id: int, to_chat_id: int):
     if not pipes:
     if not pipes:
         return
         return
     for pipe in pipes:
     for pipe in pipes:
-        if (
-            pipe["from_chat_id"] == from_chat_id
-            and pipe["to_chat_id"] == to_chat_id
-        ):
+        if pipe["from_chat_id"] == from_chat_id and pipe["to_chat_id"] == to_chat_id:
             pipes.remove(pipe)
             pipes.remove(pipe)
     return await pipesdb.update_one(
     return await pipesdb.update_one(
         {"pipe": "pipe"}, {"$set": {"pipes": pipes}}, upsert=True
         {"pipe": "pipe"}, {"$set": {"pipes": pipes}}, upsert=True
@@ -610,10 +607,7 @@ async def deactivate_pipe(from_chat_id: int, to_chat_id: int):
 
 
 async def is_pipe_active(from_chat_id: int, to_chat_id: int) -> bool:
 async def is_pipe_active(from_chat_id: int, to_chat_id: int) -> bool:
     for pipe in await show_pipes():
     for pipe in await show_pipes():
-        if (
-            pipe["from_chat_id"] == from_chat_id
-            and pipe["to_chat_id"] == to_chat_id
-        ):
+        if pipe["from_chat_id"] == from_chat_id and pipe["to_chat_id"] == to_chat_id:
             return True
             return True
 
 
 
 
@@ -657,9 +651,7 @@ async def remove_sudo(user_id: int) -> bool:
 
 
 async def blacklisted_chats() -> list:
 async def blacklisted_chats() -> list:
     chats = blacklist_chatdb.find({"chat_id": {"$lt": 0}})
     chats = blacklist_chatdb.find({"chat_id": {"$lt": 0}})
-    return [
-        chat["chat_id"] for chat in await chats.to_list(length=1000000000)
-    ]
+    return [chat["chat_id"] for chat in await chats.to_list(length=1000000000)]
 
 
 
 
 async def blacklist_chat(chat_id: int) -> bool:
 async def blacklist_chat(chat_id: int) -> bool:

+ 1 - 2
wbb/utils/files.py

@@ -65,8 +65,7 @@ async def upload_document(
         raw.functions.messages.UploadMedia(
         raw.functions.messages.UploadMedia(
             peer=await client.resolve_peer(chat_id),
             peer=await client.resolve_peer(chat_id),
             media=raw.types.InputMediaUploadedDocument(
             media=raw.types.InputMediaUploadedDocument(
-                mime_type=client.guess_mime_type(file_path)
-                or "application/zip",
+                mime_type=client.guess_mime_type(file_path) or "application/zip",
                 file=await client.save_file(file_path),
                 file=await client.save_file(file_path),
                 attributes=[
                 attributes=[
                     raw.types.DocumentAttributeFilename(
                     raw.types.DocumentAttributeFilename(

+ 0 - 1
wbb/utils/functions.py

@@ -32,7 +32,6 @@ import aiohttp
 import speedtest
 import speedtest
 from carbonnow import Carbon
 from carbonnow import Carbon
 from PIL import Image, ImageDraw, ImageFilter, ImageFont
 from PIL import Image, ImageDraw, ImageFilter, ImageFont
-
 from wbb.utils import aiodownloader
 from wbb.utils import aiodownloader
 from wbb.utils.fetch import fetch
 from wbb.utils.fetch import fetch
 
 

+ 13 - 40
wbb/utils/inlinefuncs.py

@@ -40,7 +40,6 @@ from pyrogram.raw.functions import Ping
 from pyrogram.types import (InlineKeyboardButton, InlineQueryResultArticle,
 from pyrogram.types import (InlineKeyboardButton, InlineQueryResultArticle,
                             InlineQueryResultPhoto, InputTextMessageContent)
                             InlineQueryResultPhoto, InputTextMessageContent)
 from search_engine_parser import GoogleSearch
 from search_engine_parser import GoogleSearch
-
 from wbb import (BOT_USERNAME, MESSAGE_DUMP_CHAT, SUDOERS, USERBOT_ID,
 from wbb import (BOT_USERNAME, MESSAGE_DUMP_CHAT, SUDOERS, USERBOT_ID,
                  USERBOT_NAME, USERBOT_USERNAME, app, app2, arq)
                  USERBOT_NAME, USERBOT_USERNAME, app, app2, arq)
 from wbb.core.types import InlineQueryResultCachedDocument
 from wbb.core.types import InlineQueryResultCachedDocument
@@ -118,9 +117,7 @@ async def alive_function(answers):
     ubot_state = "Dead" if not await app2.get_me() else "Alive"
     ubot_state = "Dead" if not await app2.get_me() else "Alive"
     buttons.add(
     buttons.add(
         InlineKeyboardButton("Stats", callback_data="stats_callback"),
         InlineKeyboardButton("Stats", callback_data="stats_callback"),
-        InlineKeyboardButton(
-            "Go Inline!", switch_inline_query_current_chat=""
-        ),
+        InlineKeyboardButton("Go Inline!", switch_inline_query_current_chat=""),
     )
     )
 
 
     msg = f"""
     msg = f"""
@@ -424,9 +421,7 @@ async def youtube_func(answers, text):
 **Duration:** {i.duration}
 **Duration:** {i.duration}
 **Uploaded:** {i.publish_time}
 **Uploaded:** {i.publish_time}
 **Description:** {i.long_desc}"""
 **Description:** {i.long_desc}"""
-        description = (
-            f"{i.views} | {i.channel} | " + f"{i.duration} | {i.publish_time}"
-        )
+        description = f"{i.views} | {i.channel} | " + f"{i.duration} | {i.publish_time}"
         answers.append(
         answers.append(
             InlineQueryResultArticle(
             InlineQueryResultArticle(
                 title=i.title,
                 title=i.title,
@@ -477,9 +472,7 @@ async def github_user_func(answers, text):
     result = await fetch(URL)
     result = await fetch(URL)
     buttons = InlineKeyboard(row_width=1)
     buttons = InlineKeyboard(row_width=1)
     buttons.add(
     buttons.add(
-        InlineKeyboardButton(
-            text="Open On Github", url=f"https://github.com/{text}"
-        )
+        InlineKeyboardButton(text="Open On Github", url=f"https://github.com/{text}")
     )
     )
     caption = f"""
     caption = f"""
 **Info Of {result['name']}**
 **Info Of {result['name']}**
@@ -518,9 +511,7 @@ async def github_repo_func(answers, text):
         commits += developer["contributions"]
         commits += developer["contributions"]
     buttons = InlineKeyboard(row_width=1)
     buttons = InlineKeyboard(row_width=1)
     buttons.add(
     buttons.add(
-        InlineKeyboardButton(
-            "Open On Github", url=f"https://github.com/{text}"
-        )
+        InlineKeyboardButton("Open On Github", url=f"https://github.com/{text}")
     )
     )
     caption = f"""
     caption = f"""
 **Info Of {r['full_name']}**
 **Info Of {r['full_name']}**
@@ -584,9 +575,7 @@ async def tg_search_func(answers, text, user_id):
             ),
             ),
         )
         )
         name = (
         name = (
-            message.from_user.first_name
-            if message.from_user.first_name
-            else "NO NAME"
+            message.from_user.first_name if message.from_user.first_name else "NO NAME"
         )
         )
         caption = f"""
         caption = f"""
 **Query:** {text}
 **Query:** {text}
@@ -640,9 +629,7 @@ async def music_inline_func(answers, query):
                 "duration": f_.audio.duration if f_.audio.duration else 0,
                 "duration": f_.audio.duration if f_.audio.duration else 0,
             }
             }
         )
         )
-    messages = list(
-        {v["duration"]: v for v in messages_ids_and_duration}.values()
-    )
+    messages = list({v["duration"]: v for v in messages_ids_and_duration}.values())
     messages_ids = []
     messages_ids = []
     for ff_ in messages:
     for ff_ in messages:
         messages_ids.append(ff_["message_id"])
         messages_ids.append(ff_["message_id"])
@@ -699,9 +686,7 @@ async def speedtest_init(query):
         return answers
         return answers
     msg = "**Click The Button Below To Perform A Speedtest**"
     msg = "**Click The Button Below To Perform A Speedtest**"
     button = InlineKeyboard(row_width=1)
     button = InlineKeyboard(row_width=1)
-    button.add(
-        InlineKeyboardButton(text="Test", callback_data="test_speedtest")
-    )
+    button.add(InlineKeyboardButton(text="Test", callback_data="test_speedtest"))
     answers.append(
     answers.append(
         InlineQueryResultArticle(
         InlineQueryResultArticle(
             title="Click Here",
             title="Click Here",
@@ -751,9 +736,7 @@ async def pastebin_func(answers, link):
                 InlineQueryResultArticle(
                 InlineQueryResultArticle(
                     title="DOCUMENT TOO BIG",
                     title="DOCUMENT TOO BIG",
                     description="Maximum supported size is 1MB",
                     description="Maximum supported size is 1MB",
-                    input_message_content=InputTextMessageContent(
-                        "DOCUMENT TOO BIG"
-                    ),
+                    input_message_content=InputTextMessageContent("DOCUMENT TOO BIG"),
                 )
                 )
             )
             )
             return answers
             return answers
@@ -774,9 +757,7 @@ async def pastebin_func(answers, link):
     await app.send_photo(MESSAGE_DUMP_CHAT, preview)  # To Pre-cache the media
     await app.send_photo(MESSAGE_DUMP_CHAT, preview)  # To Pre-cache the media
     buttons = InlineKeyboard(row_width=1)
     buttons = InlineKeyboard(row_width=1)
     buttons.add(InlineKeyboardButton(text="Paste Link", url=link))
     buttons.add(InlineKeyboardButton(text="Paste Link", url=link))
-    answers.append(
-        InlineQueryResultPhoto(photo_url=preview, reply_markup=buttons)
-    )
+    answers.append(InlineQueryResultPhoto(photo_url=preview, reply_markup=buttons))
     return answers
     return answers
 
 
 
 
@@ -792,9 +773,7 @@ async def pmpermit_func(answers, user_id, victim):
         InlineKeyboardButton(
         InlineKeyboardButton(
             text="For promotion", callback_data="pmpermit to_scam_you a"
             text="For promotion", callback_data="pmpermit to_scam_you a"
         ),
         ),
-        InlineKeyboardButton(
-            text="Approve me", callback_data="pmpermit approve_me a"
-        ),
+        InlineKeyboardButton(text="Approve me", callback_data="pmpermit approve_me a"),
         InlineKeyboardButton(
         InlineKeyboardButton(
             text="Approve", callback_data=f"pmpermit approve {victim}"
             text="Approve", callback_data=f"pmpermit approve {victim}"
         ),
         ),
@@ -912,9 +891,7 @@ async def carbon_inline_func(answers, link):
                 InlineQueryResultArticle(
                 InlineQueryResultArticle(
                     title="DOCUMENT TOO BIG",
                     title="DOCUMENT TOO BIG",
                     description="Maximum supported size is 1MB",
                     description="Maximum supported size is 1MB",
-                    input_message_content=InputTextMessageContent(
-                        "DOCUMENT TOO BIG"
-                    ),
+                    input_message_content=InputTextMessageContent("DOCUMENT TOO BIG"),
                 )
                 )
             )
             )
             return answers
             return answers
@@ -972,9 +949,7 @@ async def tmdb_func(answers, query):
             InlineQueryResultArticle(
             InlineQueryResultArticle(
                 title="Error",
                 title="Error",
                 description=response.result,
                 description=response.result,
-                input_message_content=InputTextMessageContent(
-                    response.result
-                ),
+                input_message_content=InputTextMessageContent(response.result),
             )
             )
         )
         )
         return answers
         return answers
@@ -1003,9 +978,7 @@ async def tmdb_func(answers, query):
         )
         )
         answers.append(
         answers.append(
             InlineQueryResultPhoto(
             InlineQueryResultPhoto(
-                photo_url=result.backdrop
-                if result.backdrop
-                else result.poster,
+                photo_url=result.backdrop if result.backdrop else result.poster,
                 caption=caption,
                 caption=caption,
                 title=result.title,
                 title=result.title,
                 description=f"{genre} • {result.releaseDate} • {result.rating} • {description}",
                 description=f"{genre} • {result.releaseDate} • {result.rating} • {description}",

+ 1 - 6
wbb/utils/json_prettify.py

@@ -27,12 +27,7 @@ async def json_object_prettify(objecc):
     dicc = objecc.__dict__
     dicc = objecc.__dict__
     output = ""
     output = ""
     for key, value in dicc.items():
     for key, value in dicc.items():
-        if (
-            key == "pinned_message"
-            or key == "photo"
-            or key == "_"
-            or key == "_client"
-        ):
+        if key == "pinned_message" or key == "photo" or key == "_" or key == "_client":
             continue
             continue
         output += f"**{key}:** `{value}`\n"
         output += f"**{key}:** `{value}`\n"
     return output
     return output

+ 1 - 4
wbb/utils/misc.py

@@ -24,7 +24,6 @@ SOFTWARE.
 from math import ceil
 from math import ceil
 
 
 from pyrogram.types import InlineKeyboardButton
 from pyrogram.types import InlineKeyboardButton
-
 from wbb import MOD_LOAD, MOD_NOLOAD
 from wbb import MOD_LOAD, MOD_NOLOAD
 
 
 
 
@@ -45,9 +44,7 @@ def paginate_modules(page_n, module_dict, prefix, chat=None):
             [
             [
                 EqInlineKeyboardButton(
                 EqInlineKeyboardButton(
                     x.__MODULE__,
                     x.__MODULE__,
-                    callback_data="{}_module({})".format(
-                        prefix, x.__MODULE__.lower()
-                    ),
+                    callback_data="{}_module({})".format(prefix, x.__MODULE__.lower()),
                 )
                 )
                 for x in module_dict.values()
                 for x in module_dict.values()
             ]
             ]