|
@@ -29,8 +29,15 @@ 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, LOG_GROUP_ID, USERBOT_NAME,
|
|
|
|
|
- aiohttpsession, app, log)
|
|
|
|
|
|
|
+from wbb import (
|
|
|
|
|
+ BOT_NAME,
|
|
|
|
|
+ BOT_USERNAME,
|
|
|
|
|
+ LOG_GROUP_ID,
|
|
|
|
|
+ USERBOT_NAME,
|
|
|
|
|
+ aiohttpsession,
|
|
|
|
|
+ app,
|
|
|
|
|
+ log,
|
|
|
|
|
+)
|
|
|
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
|
|
|
from wbb.utils import paginate_modules
|
|
from wbb.utils import paginate_modules
|
|
@@ -48,13 +55,13 @@ async def start_bot():
|
|
|
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 (
|
|
if (
|
|
|
- hasattr(imported_module, "__MODULE__")
|
|
|
|
|
- and imported_module.__MODULE__
|
|
|
|
|
|
|
+ hasattr(imported_module, "__MODULE__")
|
|
|
|
|
+ and imported_module.__MODULE__
|
|
|
):
|
|
):
|
|
|
imported_module.__MODULE__ = imported_module.__MODULE__
|
|
imported_module.__MODULE__ = imported_module.__MODULE__
|
|
|
if (
|
|
if (
|
|
|
- hasattr(imported_module, "__HELP__")
|
|
|
|
|
- and imported_module.__HELP__
|
|
|
|
|
|
|
+ hasattr(imported_module, "__HELP__")
|
|
|
|
|
+ and imported_module.__HELP__
|
|
|
):
|
|
):
|
|
|
HELPABLE[
|
|
HELPABLE[
|
|
|
imported_module.__MODULE__.replace(" ", "_").lower()
|
|
imported_module.__MODULE__.replace(" ", "_").lower()
|
|
@@ -133,9 +140,9 @@ home_keyboard_pm = InlineKeyboardMarkup(
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
home_text_pm = (
|
|
home_text_pm = (
|
|
|
- f"Hey there! My name is {BOT_NAME}. I can manage your "
|
|
|
|
|
- + "group with lots of useful features, feel free to "
|
|
|
|
|
- + "add me to your group."
|
|
|
|
|
|
|
+ f"Hey there! My name is {BOT_NAME}. I can manage your "
|
|
|
|
|
+ + "group with lots of useful features, feel free to "
|
|
|
|
|
+ + "add me to your group."
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
keyboard = InlineKeyboardMarkup(
|
|
keyboard = InlineKeyboardMarkup(
|
|
@@ -176,8 +183,8 @@ async def start(_, message):
|
|
|
elif "_" in name:
|
|
elif "_" in name:
|
|
|
module = name.split("_", 1)[1]
|
|
module = name.split("_", 1)[1]
|
|
|
text = (
|
|
text = (
|
|
|
- f"Here is the help for **{HELPABLE[module].__MODULE__}**:\n"
|
|
|
|
|
- + HELPABLE[module].__HELP__
|
|
|
|
|
|
|
+ f"Here is the help for **{HELPABLE[module].__MODULE__}**:\n"
|
|
|
|
|
+ + HELPABLE[module].__HELP__
|
|
|
)
|
|
)
|
|
|
await message.reply(text, disable_web_page_preview=True)
|
|
await message.reply(text, disable_web_page_preview=True)
|
|
|
elif name == "help":
|
|
elif name == "help":
|
|
@@ -227,8 +234,8 @@ async def help_command(_, message):
|
|
|
name = (message.text.split(None, 1)[1]).replace(" ", "_").lower()
|
|
name = (message.text.split(None, 1)[1]).replace(" ", "_").lower()
|
|
|
if str(name) in HELPABLE:
|
|
if str(name) in HELPABLE:
|
|
|
text = (
|
|
text = (
|
|
|
- f"Here is the help for **{HELPABLE[name].__MODULE__}**:\n"
|
|
|
|
|
- + HELPABLE[name].__HELP__
|
|
|
|
|
|
|
+ f"Here is the help for **{HELPABLE[name].__MODULE__}**:\n"
|
|
|
|
|
+ + HELPABLE[name].__HELP__
|
|
|
)
|
|
)
|
|
|
await message.reply(text, disable_web_page_preview=True)
|
|
await message.reply(text, disable_web_page_preview=True)
|
|
|
else:
|
|
else:
|
|
@@ -305,10 +312,10 @@ General command are:
|
|
|
if mod_match:
|
|
if mod_match:
|
|
|
module = (mod_match.group(1)).replace(" ", "_")
|
|
module = (mod_match.group(1)).replace(" ", "_")
|
|
|
text = (
|
|
text = (
|
|
|
- "{} **{}**:\n".format(
|
|
|
|
|
- "Here is the help for", HELPABLE[module].__MODULE__
|
|
|
|
|
- )
|
|
|
|
|
- + HELPABLE[module].__HELP__
|
|
|
|
|
|
|
+ "{} **{}**:\n".format(
|
|
|
|
|
+ "Here is the help for", HELPABLE[module].__MODULE__
|
|
|
|
|
+ )
|
|
|
|
|
+ + HELPABLE[module].__HELP__
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
await query.message.edit(
|
|
await query.message.edit(
|