فهرست منبع

Fixed many things

TheHamkerCat 5 سال پیش
والد
کامیت
1628da489a
5فایلهای تغییر یافته به همراه13 افزوده شده و 15 حذف شده
  1. 1 2
      wbb/__main__.py
  2. 4 4
      wbb/modules/devs.py
  3. 0 1
      wbb/modules/search.py
  4. 7 7
      wbb/modules/userbot.py
  5. 1 1
      wbb/utils/botinfo.py

+ 1 - 2
wbb/__main__.py

@@ -20,8 +20,7 @@ async def start_bot():
     global COMMANDS_COUNT
     await app2.start()
     await app.start()
-    
-    await get_info(app)
+    await get_info(app, app2)
 
     for module in ALL_MODULES:
         imported_module = importlib.import_module("wbb.modules." + module)

+ 4 - 4
wbb/modules/devs.py

@@ -102,7 +102,7 @@ async def shellrunner(client, message):
                 print(err)
                 await edit_or_reply(
                     message,
-                    text=f"**Error:**\n```{err}```")
+                    text=f"**ERROR:**\n```{err}```")
             output += f'**{code}**\n'
             output += process.stdout.read()[:-1].decode('utf-8')
             output += '\n'
@@ -122,7 +122,7 @@ async def shellrunner(client, message):
             )
             await edit_or_reply(
                 message,
-                text=f"**Error:**\n```{''.join(errors)}```")
+                text=f"**ERROR:**\n```{''.join(errors)}```")
             return
         output = process.stdout.read()[:-1].decode('utf-8')
     if str(output) == '\n':
@@ -141,9 +141,9 @@ async def shellrunner(client, message):
             return
         await edit_or_reply(
             message,
-            text=f"**Output:**\n```{output}```"
+            text=f"**OUTPUT:**\n```{output}```"
         )
     else:
         await edit_or_reply(
             message,
-            text='**Output: **\n`No output`')
+            text='**OUTPUT: **\n`No output`')

+ 0 - 1
wbb/modules/search.py

@@ -2,7 +2,6 @@ from search_engine_parser import GoogleSearch
 from pyrogram import filters
 from wbb import app, arq
 from wbb.utils.errors import capture_err
-from wikipedia import summary
 
 __MODULE__ = "Search"
 __HELP__ = '''/ud - Query Urban Dictionary

+ 7 - 7
wbb/modules/userbot.py

@@ -30,7 +30,7 @@ async def edit_or_reply(msg: Message, **kwargs):
 
 
 @app2.on_message(filters.user(OWNER_ID) & ~filters.forwarded &
-                ~filters.via_bot & filters.command("eval"))
+                ~filters.via_bot & filters.command("l","."))
 async def executor(client, message):
     try:
         cmd = message.text.split(" ", maxsplit=1)[1]
@@ -62,7 +62,7 @@ async def executor(client, message):
         evaluation = stdout
     else:
         evaluation = "Success"
-    final_output = (f"**OUTPUT**:\n```{evaluation.strip()}```")
+    final_output = (f"**INPUT:**\n```{cmd}```\n\n**OUTPUT**:\n```{evaluation.strip()}```")
     if len(final_output) > 4096:
         filename = "output.txt"
         with open(filename, "w+", encoding="utf8") as out_file:
@@ -83,7 +83,7 @@ async def executor(client, message):
     filters.user(OWNER_ID)
     & ~filters.forwarded
     & ~filters.via_bot
-    & filters.command('sh'),
+    & filters.command('sh',"."),
 )
 async def shellrunner(client, message):
     if len(message.command) < 2:
@@ -103,7 +103,7 @@ async def shellrunner(client, message):
                 print(err)
                 await edit_or_reply(
                     message,
-                    text=f"**Error:**\n```{err}```")
+                    text=f"**INPUT:**\n```{text}```\n\n**ERROR:**\n```{err}```")
             output += f'**{code}**\n'
             output += process.stdout.read()[:-1].decode('utf-8')
             output += '\n'
@@ -123,7 +123,7 @@ async def shellrunner(client, message):
             )
             await edit_or_reply(
                 message,
-                text=f"**Error:**\n```{''.join(errors)}```")
+                text=f"**INPUT:**\n```{text}```\n\n**ERROR:**\n```{''.join(errors)}```")
             return
         output = process.stdout.read()[:-1].decode('utf-8')
     if str(output) == '\n':
@@ -142,9 +142,9 @@ async def shellrunner(client, message):
             return
         await edit_or_reply(
             message,
-            text=f"**Output:**\n```{output}```"
+            text=f"**INPUT:**\n```{text}```\n\n**OUTPUT:**\n```{output}```"
         )
     else:
         await edit_or_reply(
             message,
-            text='**Output: **\n`No output`')
+            text='**INPUT:**\n```{text}```\n\n**OUTPUT: **\n`No output`')

+ 1 - 1
wbb/utils/botinfo.py

@@ -8,7 +8,7 @@ USERBOT_USERNAME = ""
 USERBOT_DC_ID = 0
 
 
-async def get_info(app):
+async def get_info(app, app2):
     global BOT_ID, BOT_NAME, BOT_USERNAME, BOT_DC_ID
     getme = await app.get_me()
     getme2 = await app2.get_me()