Bläddra i källkod

Deepsource (#109)

* Deepsource

* Removed .vim
Akshay Rajput 5 år sedan
förälder
incheckning
1966456fbf

+ 3 - 2
.vim/coc-settings.json

@@ -1,4 +1,5 @@
 {
-  "python.formatting.provider": "black",
-  "python.jediEnabled": false
+  "python.jediEnabled": false,
+  "python.linting.flake8Enabled": true,
+  "python.linting.enabled": true
 }

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

@@ -175,13 +175,10 @@ class InlineQueryResultAudio(InlineQueryResult):
         )
 
 
-"""
-    CREDITS:
 
-    THE CODE BELOW THIS LINE IS WRITTEN BY https://github.com/Mahesh0253. [https://t.me/DeletedUser420]
-    HERE IS THE ACTUAL ORIGIN:
-    https://github.com/Mahesh0253/pyrogram/blob/inline/pyrogram/types/inline_mode/inline_query_result_cached_document.py
-"""
+#  CREDITS:
+#       THE CODE BELOW THIS LINE IS WRITTEN BY https://github.com/Mahesh0253. [https://t.me/DeletedUser420]
+#       https://github.com/Mahesh0253/pyrogram/blob/inline/pyrogram/types/inline_mode/inline_query_result_cached_document.py
 
 
 class InlineQueryResultCachedDocument(InlineQueryResult):

+ 1 - 1
wbb/modules/chatbot.py

@@ -111,7 +111,7 @@ async def chatbot_talk(_, message: Message):
     await type_and_send(message)
 
 
-""" FOR USERBOT """
+# FOR USERBOT
 
 
 @app2.on_message(

+ 9 - 4
wbb/modules/greetings.py

@@ -95,11 +95,14 @@ loop.create_task(get_initial_captcha_cache())
 @capture_err
 async def welcome(_, message: Message):
     global answers_dicc
-    """ Get cached answers from mongodb in case of bot's been restarted or crashed. """
+    
+    # Get cached answers from mongodb in case of bot's been restarted or crashed.
     answers_dicc = await get_captcha_cache()
-    """Mute new member and send message with button"""
+    
+    # Mute new member and send message with button
     if not await is_captcha_on(message.chat.id):
         return
+    
     for member in message.new_chat_members:
         try:
             if member.id in SUDOERS:
@@ -178,8 +181,10 @@ async def welcome(_, message: Message):
             quote=True,
         )
         os.remove(captcha_image)
-        """ 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)
+
         asyncio.create_task(
             kick_restricted_after_delay(
                 WELCOME_DELAY_KICK_SEC, button_message, member
@@ -344,7 +349,7 @@ async def captcha_state(_, message):
         await message.reply_text(usage)
 
 
-""" WELCOME MESSAGE """
+# WELCOME MESSAGE
 
 
 @app.on_message(filters.command("set_welcome") & ~filters.private)

+ 1 - 1
wbb/modules/pmpermit.py

@@ -149,7 +149,7 @@ async def unblock_user_func(_, message):
     await eor(message, text="Successfully Unblocked the user")
 
 
-""" CALLBACK QUERY HANDLER """
+# CALLBACK QUERY HANDLER
 
 flood2 = {}
 

+ 1 - 1
wbb/modules/rice.py

@@ -29,7 +29,7 @@ from pyrogram.types import (InlineKeyboardButton,
 from wbb import app
 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 """
+# NOTE: THIS MODULE IS SPECIFICALLY FOR @DE_WM GROUP, YOU CAN REMOVE IT IN YOUR FORK IF YOU WANT TO
 
 RICE_GROUP = "DE_WM"
 RICE_CHANNEL = "RiceGallery"

+ 4 - 5
wbb/utils/dbfunctions.py

@@ -27,11 +27,10 @@ from typing import Dict, List, Union
 
 from wbb import db
 
-"""
-SOME THINGS ARE FUCKED UP HERE, LIKE TOGGLEABLES HAVE THEIR OWN COLLECTION
-(SHOULD FIX IT WITH SOMETHING LIKE TOGGLEDB, BUT I WON'T, AS IT WILL TAKE
-TOO MUCH TIME AND WILL BE BAD FOR ALREADY STORED DATA)
-"""
+
+# SOME THINGS ARE FUCKED UP HERE, LIKE TOGGLEABLES HAVE THEIR OWN COLLECTION
+# (SHOULD FIX IT WITH SOMETHING LIKE TOGGLEDB, BUT I WON'T, AS IT WILL TAKE
+# TOO MUCH TIME AND WILL BE BAD FOR ALREADY STORED DATA)
 
 
 notesdb = db.notes

+ 1 - 1
wbb/utils/inlinefuncs.py

@@ -553,7 +553,7 @@ async def speedtest_init(query):
     return answers
 
 
-""" callback query for the function above """
+# CallbackQuery for the function above
 
 
 @app.on_callback_query(filters.regex("test_speedtest"))