TheHamkerCat 5 tahun lalu
induk
melakukan
823c03fd82

+ 4 - 6
wbb/core/sections.py

@@ -1,9 +1,7 @@
-def section(title: str, body: dict, indent: int = 2, underline: bool = True) -> str:
-    text = (
-        f"**--{title}**--:\n"
-        if underline
-        else f"**{title}**:\n"
-    )
+def section(
+    title: str, body: dict, indent: int = 2, underline: bool = True
+) -> str:
+    text = f"**--{title}**--:\n" if underline else f"**{title}**:\n"
     for key, value in body.items():
     for key, value in body.items():
         if not isinstance(value, list):
         if not isinstance(value, list):
             text += f"{' ' * indent}**{key}:** `{value}`\n"
             text += f"{' ' * indent}**{key}:** `{value}`\n"

+ 11 - 10
wbb/modules/arq.py

@@ -23,9 +23,10 @@ SOFTWARE.
 """
 """
 from pyrogram import filters
 from pyrogram import filters
 
 
-from wbb import ARQ_API_URL, app, arq
+from wbb import app, arq
 from wbb.core.sections import section
 from wbb.core.sections import section
 
 
+
 @app.on_message(filters.command("arq"))
 @app.on_message(filters.command("arq"))
 async def arq_stats(_, message):
 async def arq_stats(_, message):
     data = await arq.stats()
     data = await arq.stats()
@@ -33,14 +34,14 @@ async def arq_stats(_, message):
         return await message.reply_text(data.result)
         return await message.reply_text(data.result)
     server = data.result
     server = data.result
     body = {
     body = {
-            "Uptime": server.uptime,
-            "Requests Since Uptime": server.requests,
-            "CPU": server.cpu,
-            "Memory": server.memory.server,
-            "Platform": server.platform,
-            "Python": server.python,
-            "Users": server.users,
-            "Bot": [server.bot],
-            }
+        "Uptime": server.uptime,
+        "Requests Since Uptime": server.requests,
+        "CPU": server.cpu,
+        "Memory": server.memory.server,
+        "Platform": server.platform,
+        "Python": server.python,
+        "Users": server.users,
+        "Bot": [server.bot],
+    }
     text = section("A.R.Q", body)
     text = section("A.R.Q", body)
     await message.reply_text(text)
     await message.reply_text(text)

+ 20 - 20
wbb/modules/info.py

@@ -52,15 +52,15 @@ async def get_user_info(user):
     is_sudo = user_id in SUDOERS
     is_sudo = user_id in SUDOERS
     karma = await user_global_karma(user_id)
     karma = await user_global_karma(user_id)
     body = {
     body = {
-            "ID": user_id,
-            "DC": dc_id,
-            "Name": [first_name],
-            "Username": [("@" + username) if username else None],
-            "Mention": [mention],
-            "Sudo": is_sudo,
-            "Karma": karma,
-            "Gbanned": is_gbanned
-            }
+        "ID": user_id,
+        "DC": dc_id,
+        "Name": [first_name],
+        "Username": [("@" + username) if username else None],
+        "Mention": [mention],
+        "Sudo": is_sudo,
+        "Karma": karma,
+        "Gbanned": is_gbanned,
+    }
     caption = section("User info", body)
     caption = section("User info", body)
     return [caption, photo_id]
     return [caption, photo_id]
 
 
@@ -79,17 +79,17 @@ async def get_chat_info(chat):
     dc_id = chat.dc_id
     dc_id = chat.dc_id
     photo_id = chat.photo.big_file_id if chat.photo else None
     photo_id = chat.photo.big_file_id if chat.photo else None
     body = {
     body = {
-            "ID": chat_id,
-            "DC": dc_id,
-            "Type": type,
-            "Name": [title],
-            "Username": [("@" + username) if username else None],
-            "Mention": [link],
-            "Members": members,
-            "Scam": is_scam,
-            "Restricted": is_restricted,
-            "Description": [description],
-            }
+        "ID": chat_id,
+        "DC": dc_id,
+        "Type": type,
+        "Name": [title],
+        "Username": [("@" + username) if username else None],
+        "Mention": [link],
+        "Members": members,
+        "Scam": is_scam,
+        "Restricted": is_restricted,
+        "Description": [description],
+    }
     caption = section("Chat info", body)
     caption = section("Chat info", body)
     return [caption, photo_id]
     return [caption, photo_id]
 
 

+ 1 - 3
wbb/modules/music.py

@@ -223,9 +223,7 @@ async def deezsong(_, message):
         await m.edit("Downloading")
         await m.edit("Downloading")
         proxy = "https://quotly-api.herokuapp.com"
         proxy = "https://quotly-api.herokuapp.com"
         try:
         try:
-            song = await download_song(
-                f"{proxy}?url={url}"
-            )
+            song = await download_song(f"{proxy}?url={url}")
         except Exception:
         except Exception:
             song = await download_song(url)
             song = await download_song(url)
         if not song:
         if not song:

+ 3 - 3
wbb/modules/proxy.py

@@ -37,7 +37,7 @@ def url_from_proxy(proxy: str) -> str:
 @app.on_message(filters.command("proxy") & ~filters.edited)
 @app.on_message(filters.command("proxy") & ~filters.edited)
 async def proxy_func(_, message: Message):
 async def proxy_func(_, message: Message):
     if len(proxies) == 0:
     if len(proxies) == 0:
-        await asyncio.sleep(0.5)
+        await sleep(0.5)
     location = proxies[0].location
     location = proxies[0].location
     proxy = proxies[0].proxy
     proxy = proxies[0].proxy
     url = url_from_proxy(proxy)
     url = url_from_proxy(proxy)
@@ -45,8 +45,8 @@ async def proxy_func(_, message: Message):
         [
         [
             [("Connect", url)],
             [("Connect", url)],
             [
             [
-                ("←", f"proxy_arq_-1"),
-                ("→", f"proxy_arq_1"),
+                ("←", "proxy_arq_-1"),
+                ("→", "proxy_arq_1"),
             ],
             ],
         ]
         ]
     )
     )

+ 2 - 4
wbb/modules/rice.py

@@ -21,10 +21,6 @@ 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.
 """
 """
-
-""" THIS MODULE IS SPECIFICALLY FOR @DE_WM GROUP, YOU CAN REMOVE IT IN YOUR FORK IF YOU WANT TO """
-
-
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.types import (InlineKeyboardButton,
 from pyrogram.types import (InlineKeyboardButton,
                             InlineKeyboardMarkup, InputMediaPhoto,
                             InlineKeyboardMarkup, InputMediaPhoto,
@@ -33,6 +29,8 @@ from pyrogram.types import (InlineKeyboardButton,
 from wbb import app
 from wbb import app
 from wbb.core.decorators.errors import capture_err
 from wbb.core.decorators.errors import capture_err
 
 
+""" THIS MODULE IS SPECIFICALLY FOR @DE_WM GROUP, YOU CAN REMOVE IT IN YOUR FORK IF YOU WANT TO """
+
 RICE_GROUP = "DE_WM"
 RICE_GROUP = "DE_WM"
 RICE_CHANNEL = "RiceGallery"
 RICE_CHANNEL = "RiceGallery"
 
 

+ 8 - 4
wbb/modules/stickers.py

@@ -27,8 +27,8 @@ from traceback import format_exc
 
 
 from pyrogram import filters
 from pyrogram import filters
 from pyrogram.errors.exceptions.bad_request_400 import (
 from pyrogram.errors.exceptions.bad_request_400 import (
-    PeerIdInvalid, ShortnameOccupyFailed, StickerPngDimensions,
-    StickerPngNopng, UserIsBlocked, StickerEmojiInvalid)
+    PeerIdInvalid, ShortnameOccupyFailed, StickerEmojiInvalid,
+    StickerPngDimensions, StickerPngNopng, 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
@@ -163,9 +163,13 @@ async def kang(client, message):
                 continue
                 continue
             else:
             else:
                 try:
                 try:
-                    await add_sticker_to_set(client, stickerset, sticker)
+                    await add_sticker_to_set(
+                        client, stickerset, sticker
+                    )
                 except StickerEmojiInvalid:
                 except StickerEmojiInvalid:
-                    return await msg.edit("[ERROR]: INVALID_EMOJI_IN_ARGUMENT")
+                    return await msg.edit(
+                        "[ERROR]: INVALID_EMOJI_IN_ARGUMENT"
+                    )
             break
             break
 
 
         await msg.edit(
         await msg.edit(

+ 1 - 2
wbb/utils/inlinefuncs.py

@@ -25,7 +25,6 @@ import asyncio
 import json
 import json
 import os
 import os
 import sys
 import sys
-from random import randint
 from re import sub as re_sub
 from re import sub as re_sub
 from sys import version as pyver
 from sys import version as pyver
 from time import ctime, time
 from time import ctime, time
@@ -722,8 +721,8 @@ async def pmpermit_func(answers, user_id, victim):
 
 
 
 
 async def ping_func(answers):
 async def ping_func(answers):
+    ping = Ping(ping_id=app.rnd_id())
     t1 = time()
     t1 = time()
-    ping = Ping(ping_id=randint(696969, 6969696))
     await app.send(ping)
     await app.send(ping)
     t2 = time()
     t2 = time()
     ping = f"{str(round((t2 - t1) * 1000, 2))} ms"
     ping = f"{str(round((t2 - t1) * 1000, 2))} ms"